Write a program that asks the user to enter the number of passengers in an airplane and the weight of baggage for these passengers. Your program should then print the average weight of all baggage; it should also print the weights in reverse order. Sample run: Enter the number of passengers in the airplane: 8 Enter the weights of 8 baggage: 16 45 60 13 24 29 50 30 The average weight of all baggage is 33.375 The entered weights in reverse order are 30 50 29 24 13 60 45 16

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter5: Looping
Section: Chapter Questions
Problem 14E: In Chapter 4, you created a program that generates a random number, allows a user to guess it, and...
icon
Related questions
Question
ll alfa
8:10 PM
96% D
A docs.google.com
11736151
*
Question 1
Write a program that asks the user to enter the number of passengers in an airplane and the
weight of baggage for these passengers. Your program should then print the average weight
of all baggage; it should also print the weights in reverse order.
Sample run:
Enter the number of passengers in the airplane: 8
Enter the weights of 8 baggage: 16 45 60 13 24 29 50 30
The average weight of all baggage is 33.375
The entered weights in reverse order are 30 50 29 24 13 60 45 16
Your answer
Question 2
Write a method int countMultiplesofFive ( int x, int y) that returns the number of multiples
of 5 bounded between x and y inclusive.
In the main, generate two random numbers between 7 and 92 inclusive. Use the method
countMultiplesofFive to find and print how many multiple of 5 exists between the two
randomly generated numbers inclusive.
Sample run 1:
First random: 11
Second random: 80
There are 14 number that are multiple of five between 11 and 80
Transcribed Image Text:ll alfa 8:10 PM 96% D A docs.google.com 11736151 * Question 1 Write a program that asks the user to enter the number of passengers in an airplane and the weight of baggage for these passengers. Your program should then print the average weight of all baggage; it should also print the weights in reverse order. Sample run: Enter the number of passengers in the airplane: 8 Enter the weights of 8 baggage: 16 45 60 13 24 29 50 30 The average weight of all baggage is 33.375 The entered weights in reverse order are 30 50 29 24 13 60 45 16 Your answer Question 2 Write a method int countMultiplesofFive ( int x, int y) that returns the number of multiples of 5 bounded between x and y inclusive. In the main, generate two random numbers between 7 and 92 inclusive. Use the method countMultiplesofFive to find and print how many multiple of 5 exists between the two randomly generated numbers inclusive. Sample run 1: First random: 11 Second random: 80 There are 14 number that are multiple of five between 11 and 80
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning