Cash-back offer from May 2nd to 7th, 2024: Get a flat 10% cash-back credited to your account for a minimum transaction of $50.Post Your Questions Today!

Question DetailsNormal
$ 8.00

COMP1010 Programming_Quiz 1 | Complete Solution

Question posted by
Online Tutor Profile
request

COMP1010 Programming_Quiz 1 Fall 2017

The Collatz Conjecture

According to Wikipedia: The Collatz conjecture is a conjecture in mathematics named after Lothar Collatz, who first proposed it in 1937. The conjecture is also known as the 3n + 1 conjecture, the Ulam conjecture (after Stanisław Ulam), Kakutani's problem (after Shizuo Kakutani), the Thwaites conjecture (after Sir Bryan Thwaites), Hasse's algorithm (after Helmut Hasse), or theSyracuse problem; [1][2] the sequence of numbers involved is referred to as the hailstone sequence or hailstone numbers (because the values are usually subject to multiple descents and ascents like hailstones in a cloud),[3][4] or as wondrous numbers.

Take any natural number n. If n is even, divide it by 2 to get n / 2. If n is odd, multiply it by 3 and add
1 to obtain 3n + 1. Repeat the process (which has been called "Half Or Triple Plus One", or HOTPO[6]) indefinitely. The conjecture is that no matter what number you start with, you will always eventually reach 1. The property has also been called oneness.
Create a project called Program1. Add a C source file to the project named program1.c. Your
program should create a table of numbers providing information about the number of steps that a
particular number takes in order to reach the number 1 in the sequence described above. Your program
should create the table by first asking the user to enter a starting integer > 1 and less than 1000 (ONE
THOUSAND) and then an ending number that is greater than their starting number and less than 10000
(TEN THOUSAND). For every integer in between, and including the start and end points, your program
should compute the number of steps it takes to reach the number 1 and display it beside the original
number. A sample run with the starting point of 2 and the ending point of 99 is given below:
COMP1010 Programming_Quiz 1 Fall 2017 - Dr. Mwaura
Your program should print a maximum of 7 columns per line where each column follows the
following format rules: The first number is printed right justified in 5 spaces then a colon is printed then
the number of steps is written as a left justified number in 5 spaces. The end result is that we get columns
centered on the colon character as shown in the screenshot.

You should make use of functions to make your code easy to read.
At the top of your program you should have a comment section that follows the below format:
/***********************************************
Author: <insert your name>
Date: <insert today’s date>
Purpose: <Insert a short description of what
your program does here.>
Time Spent: <Insert how much time you spent
on the assignment here>
***********************************************/

Available Answer
$ 8.00

[Solved] COMP1010 Programming_Quiz 1 | Complete Solution

  • This solution is not purchased yet.
  • Submitted On 04 Dec, 2017 08:28:28
Answer posted by
Online Tutor Profile
solution
This Solution is rated A+ previously,if yo...
Buy now to view the complete solution
Other Similar Questions
User Profile
AceTu...

COMP1010 Programming_Quiz 1 | Complete Solution

This Solution is rated A+ previously,if you have any questions regarding this tutorial than you can contact me. Check your E-mail inbox to download your solution document....

The benefits of buying study notes from CourseMerits

homeworkhelptime
Assurance Of Timely Delivery
We value your patience, and to ensure you always receive your homework help within the promised time, our dedicated team of tutors begins their work as soon as the request arrives.
tutoring
Best Price In The Market
All the services that are available on our page cost only a nominal amount of money. In fact, the prices are lower than the industry standards. You can always expect value for money from us.
tutorsupport
Uninterrupted 24/7 Support
Our customer support wing remains online 24x7 to provide you seamless assistance. Also, when you post a query or a request here, you can expect an immediate response from our side.
closebutton

$ 629.35