Question

In: Computer Science

PLEASE ANSWER USING C# Is there a Prius version? Did you know that the average Boeing...

PLEASE ANSWER

USING C#

Is there a Prius version? Did you know that the average Boeing 747 airplane uses approximately 1 gallon of fuel per second? Given the speed of the airplane, that means it gets 5 gallons to the mile. No, not 5 miles to the gallon, 5 gallons to the mile. You may be questioning why such a horribly inefficient machine is allowed to exist, but you’ll be happy to find out that, because this airplane hold 568 people, it averages about 0.01 gallons per person – (100 miles per gallon per person). Your job is to design (pseudocode) and implement (source code) a program that asks the user for a distance the plane has to fly (i.e. the length of the trip) and also asks the cost of jet fuel (which is currently $1.80 per gallon). The program should then calculate the total fuel charges to make the trip. Next, ask the user how many people will fly, as well as the average cost of a ticket. Finally, print the total profit made (or lost) and the average gas mileage per person. Document your code and properly label the input prompts and the outputs as shown below.

Sample run 1:

Enter the flight distance: 1000

Enter the current cost of jet fuel: $2 The flight will cost $10000.0 in fuel.

Enter the number of passengers: 5

Enter the average cost of a ticket: 1000

You will make a profit of $-5000.0

You averaged 1.0 miles per person per gallon!

Solutions

Expert Solution

Result:

Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FlightDistanceCalcConsole
{
class Program
{
static void Main(string[] args)
{
int distance;
Console.WriteLine("Enter the flight distance");
distance = Convert.ToInt16(Console.ReadLine());

int cost;
Console.WriteLine("Enter the current cost of jet fuel");
cost = Convert.ToInt16(Console.ReadLine());

double amount;
amount=(distance*5)*2;
Console.WriteLine("The flight will cost " + amount);


int passengers;
Console.WriteLine("Enter number of passengers");
passengers = Convert.ToInt16(Console.ReadLine());

int ticketCost;
Console.WriteLine("Enter the average cost of ticket");
ticketCost = Convert.ToInt16(Console.ReadLine());

double profit;
profit = ticketCost * passengers;
Console.WriteLine("You will make profit " + profit);

Console.ReadLine();
}
}
}

Waiting for your comments


Related Solutions

PLEASE DO THIS IN C#.Is there a Prius version? Did you know that the average Boeing...
PLEASE DO THIS IN C#.Is there a Prius version? Did you know that the average Boeing 747 airplane uses approximately 1 gallon of fuel per second? Given the speed of the airplane, that means it gets 5 gallons to the mile. No, not 5 miles to the gallon, 5 gallons to the mile. You may be questioning why such a horribly inefficient machine is allowed to exist, but you’ll be happy to find out that, because this airplane hold 568...
IN C++ LANGUAGE PLEASE:::: Is there a Prius version? Did you know that the average Boeing...
IN C++ LANGUAGE PLEASE:::: Is there a Prius version? Did you know that the average Boeing 747 airplane uses approximately 1 gallon of fuel per second?  Given the speed of the airplane, that means it gets 5 gallons to the mile. No, not 5 miles to the gallon, 5 gallons to the mile.   You may be questioning why such a horribly inefficient machine is allowed to exist, but you’ll be happy to find out that, because this airplane hold 568 people, it...
JAVA please Program 4: Is there a Prius version? Did you know that the average Boeing...
JAVA please Program 4: Is there a Prius version? Did you know that the average Boeing 747 airplane uses approximately 1 gallon of fuel per second? Given the speed of the airplane, that means it gets 5 gallons to the mile. No, not 5 miles to the gallon, 5 gallons to the mile. You may be questioning why such a horribly inefficient machine is allowed to exist, but you’ll be happy to find out that, because this airplane hold 568...
IN JAVA PLEASE Program 4: Is there a Prius version? Did you know that the average...
IN JAVA PLEASE Program 4: Is there a Prius version? Did you know that the average Boeing 747 airplane uses approximately 1 gallon of fuel per second? Given the speed of the airplane, that means it gets 5 gallons to the mile. No, not 5 miles to the gallon, 5 gallons to the mile. You may be questioning why such a horribly inefficient machine is allowed to exist, but you’ll be happy to find out that, because this airplane hold...
IMPORTANT: I know the answer is "C". However, I don't know why. Could you please explain...
IMPORTANT: I know the answer is "C". However, I don't know why. Could you please explain why? Thank you A linear total cost curve that passes through the origin implies that a.         average cost is constant and marginal cost is variable. b.         average cost is variable and marginal cost is constant.             c.         average and marginal costs are constant and equal.             d.         you need more information to answer question.
C# please answer if you know, don't copy others answers, Prime factors are the combination of...
C# please answer if you know, don't copy others answers, Prime factors are the combination of the smallest prime numbers, that, when multiplied together, will produce the original number. Consider the following example: Prime factors of 4 are: 2 x 2 Prime factors of 7 are: 7 Prime factors of 30 are: 2 x 3 x 5 Prime factors of 40 are: 2 x 2 x 2 x 5 Prime factors of 50 are: 2 x 5 x 5 Create...
Please if you are able to answer the question below: Write C++ program using native C++...
Please if you are able to answer the question below: Write C++ program using native C++ (you can use STL)  that produces Huffman code for a string of text entered by the user.  Must accept all ASCII characters.  Pleas explain how you got frequencies of characters, how you sorted them, how you got codes.
Please answer in C++! Let me know if you have any questions about these. Program 1:...
Please answer in C++! Let me know if you have any questions about these. Program 1: For this program, imagine we want to track an object and detect if it goes off the left or right side of the screen (that is, it’s X position is less than 0 and greater than the width of the screen, say, 100). Write a program that asks the user for the starting X and Y position of the object as well as the...
(C++) Write version 1.0 of the Rider class for the elevator simulation. Riders will "know" their...
(C++) Write version 1.0 of the Rider class for the elevator simulation. Riders will "know" their starting floor and their destination floor. But instead of using pointers or reference variables as data members, they use whole number int s. (The simulation will have an array of floor objects to which all classes will have access, so all that's needed to refer to a floor is its index in the global array.) Here's its specification: As the only data members, two...
Imaging you work for Boeing Coporation. Please answer question at least 250 words. What are the...
Imaging you work for Boeing Coporation. Please answer question at least 250 words. What are the specific benefits would be benefits multiculturalism and Diversity &Inclusion for this company? Present a new multicultural statement for your company. Think of this like a mission statement. You are going to be running this initiative and rolling it out at the company.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT