For My Java class, this being my first programming class, I have been asked to complete the following to learn Loops. Next is arrays but I was hoping to get help understanding this first. Thanks 1-Design a program that asks the user to enter a series of positive numbers. The user should enter a negative number to signal the end of the series. After all the positive numbers have been entered, the program should display their sum.
For My Java class, this being my first
1-Design a program that asks the user to enter a series of positive numbers. The user should enter a negative number to signal the end of the series. After all the positive numbers have been entered, the program should display their sum.
2-The distance a vehicle travels can be calculated as follows: Distance = Speed x Time
Design a program that asks a user for the speed of a vehicle in miles per hour and how many hours it has travelled (Assume the two values are integers). Your program should then use a loop to display the distance the vehicle has traveled for each hour of that time period. (For example, entering 50 mph and 4 hours should produce output like: Hour 1: 50 miles, Hour 2: 100 miles, Hour 3: 150 miles, Hour 4: 200 miles. )
3-Design a program that uses nested loops to display a multiplication table for numbers 1 through 12.
Step by step
Solved in 6 steps with 2 images