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

Incorrect; the answer was 266

You solved 2 correctly

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

assignment one Due Thursday In our discussion last week, we

  assignment one Due Thursday  In our discussion last week, we considered the many societal groups we belong to and how those groups and others, at both the micro- and macro-level, contribute to a complex society. Not all groups are perceived or treated equally in our society. Like other social

This week you learned about the application of motivational strategies

  This week you learned about the application of motivational strategies and diversity, equity, and inclusion practices essential for promoting a positive organizational culture. Now you’ll practice your skills by reviewing a scenario, researching diversity in the workplace, and completing an analysis and plan chart. Complete the Navigating Employee Groups Worksheet.

THEORIES AND WORLDVIEW

 Description THEORIES AND WORLDVIEW ESSAY Purpose To write an essay in which you compare the foundational features of your worldview with the foundational features of one developmental theory discussed in our course materials. Background Every person who has ever lived bases his or her life on a set of basic

Ayn Rand Essay

Description Does the World Council of Scholars reject Equality only because he is different or for some additional reason? What is it about Equality, specifically, that they are so opposed to, and what do you think motivates their opposition toward him? Use examples from the text to help explain your

Compare the physical assessment of a child to that of

 Compare the physical assessment of a child to that of an adult. In addition to describing the similar/different aspects of the physical assessment, explain how the nurse would offer instruction during the assessment, how communication would be adapted to offer explanations, and what strategies the nurse would use to encourage

growth, development, and learned behaviors that occur during the first

growth, development, and learned behaviors that occur during the first year of infancy have a direct effect on the individual throughout a lifetime. For this assignment, research an environmental factor that poses a threat to the health or safety of infants and develop a health promotion that can be presented

Respond to both students with 200 words and also include

Respond to both students with 200 words and also include a question in response. Breanna Brown: What is alcohol? Alcohol is also known as ethanol. Alcohol is not a nutrient. Common sources of alcohol are beer, wine, hard liquor ( whiskey, vodka, rum), tuba, fermented yeast. Excessive alcohol consumption is

Storm of Steel, Junger/All Quiet on the Western Front, Remarque

Storm of Steel, Junger/All Quiet on the Western Front, Remarque  IT MUST be a minimum of one page, single-spaced in 10 pt. Times Roman font. Do not use a header (name, date, title, professor’s name). Do not use outside sources. Remember to write a complete it . Plagiarism will not

STU ADHD Management Psychiatric SOAP Note Template Nursing Assignment Help

Step 1: You will use the Graduate Comprehensive Psychiatric Evaluation Template Download Graduate Comprehensive Psychiatric Evaluation Templateto: Compose a written comprehensive psychiatric evaluation of a patient you have seen in the clinic. Upload your completed comprehensive psychiatric evaluation as a Word doc. Scanned PDFs will not be accepted. For the

Pneumonia Respiratory Discussion Nursing Assignment Help

(PART 2) What is due in Module 7: Using the information in your text, scholarly resources, course lectures, videos and other depictions (e.g., graphs, tables, charts), you will discuss and research the items 1-5 below for discussion #1, which will be graded using the Discussion Rubric following in detail. Discussions

PROPOSAL TO JGJ (on Online high school) Construct a proposal

PROPOSAL TO JGJ (on Online high school) Construct a proposal to JGJ Inc. of 1000 words (+/- 50 words) using at least four credible and objective sources not provided as resources in the course in your analysis, plus at least one source provided in the course reading list. Use the

Write a short report illustrating an example of a project

 Write a short report illustrating an example of a project undertaken by a company, municipality, or non-profit organization demonstrating how this project links to the organization’s mission, vision, and values. If possible, show the numerical rationale (NPV, IRR, Payback Period) used as a rationale.    NOTE 1: I have attached

1. Competitive Advantage and Data Analytics https://robertforto.com/wp-content/uploads/2021/11/Forto-R.-720-Paper-5-final.pdf 2. Evaluate and

1. Competitive Advantage and Data Analytics https://robertforto.com/wp-content/uploads/2021/11/Forto-R.-720-Paper-5-final.pdf 2. Evaluate and decide how you would respond to a data-driven competitor analysis that focuses on technology operations. What criteria would be of the most value? What information would be most important to you? Need 500 words with reference for each point

Instructions Contract Scenario Calvin had been an avid coin collector

  Instructions Contract Scenario Calvin had been an avid coin collector for many years, and the most valuable coin in his collection was an uncirculated, mint condition, 1943 Lincoln penny made of copper (most pennies made during World War II were made of zinc because copper was needed in the

Management Majors: Develop a business plan for a start-up company

   Management Majors: Develop a business plan for a start-up company that plans to sell a product or service in a local market, in a national market, or on the Internet. Select one of your favorite products as the basis for the company, or invent a product. Create a business