Need help? We are here

# Question 1: Write a program that asks the user for

Question 1:

Write a program that asks the user for a positive nonzero integer value. The program should use a loop (while loop) to get the sum of all the integers from 1 up to the number entered. For examples, if the user enters 50, the loop will find the sum of 1,2,3,4,….50.

Hint: You need two while loops here. One to make sure the user enters a positive number (keeps on asking the user for a number till he\she enters a positive nonzero number).  And two to find the sum.

Question 2:

The distance a vehicle travels can be calculated as follows:

Distance = Speed * Time

For example, if a train travels 40 miles per hour for 3 hours, the distance traveled is 120 miles. Write a program that asks for the speed of a vehicle (in miles per hour) and the number of hours it has traveled. It should use a loop to display the distance a vehicle has traveled for each hour of a time period specified by the user. For example, if a vehicle is traveling at 40 mph for a 3 hour time period, it should display a report similar to the one that follows:

Hours                                    Distance

1                                              40
2                                              80
3                                              120

Input validation: Do not accept a negative number for speed and do not accept any value less than 1 for time traveled (i.e. use a loop to keep on asking the user till he\she gives you an acceptable value for both).

Question 3:

Write a program that will predict the size of a population of organisms. The program should ask for the starting number of organisms, their average daily population increase (as a percentage), and the number of days they will multiply. For example, a population might begin with two organisms, have an average daily increase of 50 percent, and will be allowed to multiply for seven days. The program should use a loop to display the size of the population for each day. So for the previous example, the output should look like:

Day                        Organisms

—————————–

1                              2.0

2                              3.0

3                              4.5

4                              6.75

5                              10.125

6                              15.1875

7                              22.78125

Input validation: Do not accept a number less than 2 for the staring size of the population. Do not accept a negative number for average percent daily population increase. Do not accept a number less than 1 for the number of days they will multiply.

Question 4:

Write a program with a loop that lets the user enter a series of integers. The user should enter -99 to signal the end of the series. After all the numbers have been entered, the program should display the largest and smallest numbers entered.

Question 5:

Write a program that displays a table of centigrade temperatures 0 through 20 and their Fahrenheit equivalents. The formula for converting a temperature from centigrade to Fahrenheit is:

F =  9\5 * C + 32

Where F is the Fahrenheit temperature and C is the centigrade temperature. Your program must use a loop to display the table.

Question 6:

Write a multiplication tutor program. Ask user to solve problems with random numbers from 1-20. The program stops after an incorrect answer. The output should look like:

14 * 8 = 112

Correct!

5 * 12 = 60

Correct!

8 * 3 = 24

19 * 14 = 256

You solved 2 correctly

Pages (275 words)
Standard price: \$0.00

### Latest Reviews

Impressed with the sample above? Wait there is more

Related Questions

### n the accommodations market, Airbnb appears to have a significant

n the accommodations market, Airbnb appears to have a significant advantage over its competitors as it relates to regulations affecting the operations of its business.

### Application – Review Question #5 on page 31 in the

Application – Review Question #5 on page 31 in the textbook. Application – Your Turn: The Role of Labor Costs in Retail Electronics on pages

### Create a multimedia poster using Publisher PowerPoint Word Glogster or other software program of your choosing. Pictorially and through short

Create a multimedia poster using Publisher, PowerPoint, Word, Glogster, or other software program of your choosing. Pictorially and through short phrases, critique the adoption of

### Reflection #3: Group Size and Ratio (pgs. 27-28 in the

Reflection #3: Group Size and Ratio (pgs. 27-28 in the blue book). Please submit the Group Size and Ratio Checklist.  Please also submit a 1/2-1

### Instructions – PLEASE  · The Assignment must be submitted on Blackboard

Instructions – PLEASE  · The Assignment must be submitted on Blackboard (WORD format only) via allocated folder. ·. This includes filling your information on

### What is the staff nurse’s role in evidence-based practice in

What is the staff nurse’s role in evidence-based practice in your organization? How much do you think evidence-based practice is valued by your colleagues on

### Obtain feedback from the leader

Details: Combine all elements completed in previous weeks (Topics 1-4) into one cohesive evidence-based proposal and share the proposal with a leader in your organization.

### Identify a value that you believe strongly influences your understanding of nursing. Draw a picture take a photograph or use

Identify a value that you believe strongly influences your understanding of nursing. Draw a picture, take a photograph, or use a internet picture that you

### Crime Scene Project Part 2 Instructions Now that you have finished the crime scene part of the program

Crime Scene Project Part 2 InstructionsNow that you have finished the “crime scene” part of the program, it is time to enter the laboratory. Once

### Data Gathering Instrument Task: Create one (1) instrument that could be

Data Gathering Instrument Task: Create one (1) instrument that could be used to gather data for your mock dissertation topic. (cyber secuirty)The instrument should

### Complete two problems related to strategically managing global financial issues.

Complete two problems related to strategically managing global financial issues. The problems focus on currency appreciation and exchange rates. Introduction By successfully completing this

### Discussion response #1 RE:” Retraining the general manager on how

Discussion response #1 RE:” Retraining the general manager on how to efficiently conduct performance evaluations and reiterating the significance of doing so correctly and successfully

New questions

### MHA 543 UP Multigenerational Workforce Conflicts Nursing Assignment Help

In the 21st century, the health care workforce is made up of four different generations of workers, who now operate from many different cultural perspectives.

### USC Community Strategic Plan for Public Health Issue Nursing Assignment Help

For this assignment, you will research and prepare a community-level strategic plan that addresses a key public health issue. Potential topics may include: Using prenatal

### Module 1 Please draft a short essay (1 page max) describing Nursing Assignment Help

Module 1 Please draft a short essay (1 page max) describing below.Why did you come to St. Joe’s? great schoolWhy did you choose this degree?

### Health & Medical Healthcare Organization Ratio Analysis Nursing Assignment Help

You are a mid-level manager in a health care organization and you have been asked to prepare a report, with appropriate exhibits, for the senior

### GCU Evidence Hierarchy in Literature Discussion Nursing Assignment Help

I’m working on a health & medical question and need the explanation and answer to help me learn. Discuss the hierarchy of evidence, specifically as