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

Women in the Koran – Premium Paper Help

Premium Paper Help is a professional writing service that provides original papers. Our products include academic papers of varying complexity and other personalized services, along with research materials for assistance purposes only. All the materials from our website should be used with proper references.

I need answers for these questions for 5 articles I

I need answers for these questions for 5 articles I will upload them … What was the purpose of this research? What was the problem the researcher(s) addressed? What are the research questions? What method and design were used in this research? What were the results of the research? What

Disabilities Law brochure

 you will design a brochure that include the following sections: Purpose of the brochure Overview of IDEA and its components( must be the most large section) Overview of the section 504 and ADA Resources at federal , state and local levels – minimum of two at each level The brochure

Assignment: Provide a reflection of at least 500 words (or

  Assignment:Provide a reflection of at least 500 words (or 2 pages double spaced) of how the knowledge, skills, or theories of this course have been applied, or could be applied, in a practical manner to your current work environment. If you are not currently working, share times when you

Instructions: Please read the instructions carefully and contact me if

Instructions: Please read the instructions carefully and contact me if you have any questions prior to submitting your work. After reading the chapter and reviewing the PowerPoint and supplemental readings on the course site, you should complete the following tasks:  Answer the questions below. Your responses should be about one,

students will create an ELL Welcome Packet using PowerPoint for

 students will create an ELL Welcome Packet using PowerPoint for new ELL students in their class which will include important phrases in the student’s native language as well as a series of classroom activities  Cover Slide with Title and Student Names Important information for newcomers, such as classroom number, school

Install your own copy of Kali and demo the tool

Install your own copy of Kali and demo the tool Zenmap from Kali and show your demo with your own screenshots. Submit the report to this link. If you are using the new Kali, you and Zenmap is not installed, either you install it manually or use anyone of the

Discussion Directions Students will need to post a link to

  Discussion Directions Students will need to post a link to an article from Wall Street Journal regarding a current event (something in the last 60 days before each post) regarding a topic of your choice from related Chapters.  The Post  Here are some topics to consider from chapters 1

Create a situation audit of your own organization.

For this project, you will be creating a situation audit of your own organization. You will prepare to conduct your audit over the next 12 steps of this project, during which you will review various aspects of your organization, including its mission, goals, and values. You will be given the

UNIDAD IV – DROGAS QUE INFLUYEN LA ADAPTACIÓN EN EL

UNIDAD IV – DROGAS QUE INFLUYEN LA ADAPTACIÓN EN EL CONTINUUM SALUD ENFERMEDAD EN LOS MODOS DE ADAPTACIÓN UNIDAD IV – DROGAS QUE INFLUYEN LA ADAPTACIÓN EN EL CONTINUUM SALUD ENFERMEDAD EN LOS MODOS DE ADAPTACIÓN 4. Señalar doce (12) acciones de enfermería al administrar medicamentos que afectan el sistema

When responding, reply to the message rather than starting new

When responding, reply to the message rather than starting new threads. It is currently set that you must first post your thread before you are allowed to see other posts. This should help generate more personalized responses for each of the given sources. Keep this in mind when reading the

In this assignment you will choose three general topics of

 In this assignment you will choose three general topics of interest to you related to psychological assessment from the list below. Infants and preschool-aged children Children ages 5 through 12 years Children with neurodevelopmental disorders Neuropsychological assessment of adolescents Children and adolescents with anxiety disorders Children with attention deficit/hyperactivity disorder

The Institutional Structure of the Communist Party-State

Part B The Institutional Structure of the Communist Party-State (4) 16.11.2018: The Chinese Communist PartyGuiding Question: Describe the role of CCP within the Chinese political system. How can it stabilize the ruling of the Chinese authoritarian regime?Required Reading:- Saich, T. (2015). Governance and politics of China. Macmillan International Higher Education,

Final. Take home. Each student shall write a 4 pages

   Final. Take home. Each student shall write a 4 pages in which they critically interact with the following questions:  1. What were the three most valuable lessons you learned in the class? 2. Why were they the most valuable? 3. How have they affected your character?  4. How will

  ScenarioAs you recall, number two on the National Quality Strategy Priorities is person-and family-centered care. Prior to the 1980s, family and visitors were restricted to a few hours at a time a Nursing Assignment Help

  Scenario As you recall, number two on the National Quality Strategy Priorities is person-and family-centered care. Prior to the 1980s, family and visitors were restricted to a few hours at a time and absolutely prohibited to stay overnight. When family arrived on discharge day, they were given minimal instructions on

I want a 5 page writing and the topic is:

I want a 5 page writing and the topic is: “How synchronous is global growth among key country blocs/regions? (Please consider a somewhat long history of 40-50 years).” So it should be emphasizing the business and economic growth on past 40-50 years stories. Like why some regions had a quick

Omni-Channel Analysis – Premium Paper Help

Premium Paper Help is a professional writing service that provides original papers. Our products include academic papers of varying complexity and other personalized services, along with research materials for assistance purposes only. All the materials from our website should be used with proper references.

Traditional thinking views a problem in isolated parts, each part

  Traditional thinking views a problem in isolated parts, each part as linear having a cause and effect that is managed. Systems thinking recognizes that a complex system managed in the traditional way will result in unintended consequences and enhance complexity instead of resolving the problem. Provide an example of