Question

In: Computer Science

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 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

main.cs:

using System;

class MainClass {

public static void Main (string[] args) {

Console.WriteLine ("Welcome to the Airpane calculator");

Console.WriteLine("Enter the flight distance: ");

int distance = Convert.ToInt32(Console.ReadLine());

Console.WriteLine("Enter the current cost of jet fuel: ");

int fuel = Convert.ToInt32(Console.ReadLine());

double costFlight = (distance*5) * fuel;

Console.WriteLine("The flight will cost $"+costFlight+" in fuel.");

Console.WriteLine("Enter the number of passengers: ");

int passengers = Convert.ToInt32(Console.ReadLine());

Console.WriteLine("Enter the average cost of a ticket: ");

double average = Convert.ToDouble(Console.ReadLine());

double profit = (passengers * average) - costFlight ;

Console.WriteLine("You will make a profit of $"+profit);

}

}

Output:


Related Solutions

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...
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...
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...
Please do in java Program 3: Give a baby $5,000! Did you know that, over the...
Please do in java Program 3: Give a baby $5,000! Did you know that, over the last century, the stock market has returned an average of 10%? You may not care, but you’d better pay attention to this one. If you were to give a newborn baby $5000, put that money in the stock market and NOT add any additional money per year, that money would grow to over $2.9 million by the time that baby is ready for retirement...
(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...
How well do you really know your customers? And how well did they want to know...
How well do you really know your customers? And how well did they want to know you right?
As a supervisor in Starbucks how did you know what to do in a Starbucks? how...
As a supervisor in Starbucks how did you know what to do in a Starbucks? how you learn to do your job? what worked? why? What could have been done better? Why?
Did you know that there are over 500 types of bananas in the world? Did you...
Did you know that there are over 500 types of bananas in the world? Did you also know that bananas are an excellent source of potassium, fiber, and vitamin B-6 as well as serve as a powerful antioxidant? However, most people might not be aware of the prolific amount of banana consuming possibilities that are available to them. Wouldn't it be amazing if we have a program that would randomly recommend a type of banana for someone to eat every...
PLEASE DO NOT ANSWER THIS IF YOU DO NOT KNOW IT. Last time I posted, someone...
PLEASE DO NOT ANSWER THIS IF YOU DO NOT KNOW IT. Last time I posted, someone literally copied and pasted from an article and it was very difficult to understand. 1) What is meant by Factoring of Accounts Receivables? 2) List 3 advantages of Factoring 3) List 3 disadvantages of Factoring 4) List 3 Factors in the USA. 5) If you are a company that factors your receivables, would you prefer "recourse" or "non-recourse" factoring? Explain your choice.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT