Reference no: EM132365385
Program 1: I'm buyin' a Ferrari! If you've ever travelled to another country, you know that working with different currencies takes a while to get used to. As of the date of making this assignment, there are 9,240.00 Guinean Francs to $1 USD. For this program, design (pseudocode) and implement (source code) a program that prompts the user for the amount of U.S. currency they have, and converts it into Ginean Francs.
Document your code and properly label the input prompts and the outputs as shown below.
Sample run 1:
Enter an amount in USD: $50
You have 462000.0 Guinean Francs Sample run 2:
Enter an amount in USD: $313
You have 2892120.0 Guinean Francs
Program 2: All Hail Modulus Agustus! The modulus operator is used all the time. Realize that if you "mod" any number by a number "n", you'll get back a number between 0 and n-1. For example, "modding" any number by 20 will always give you a number between 0-19. Your job is to design (pseudocode) and implement (source code) a program to sum the total of all digits in an input integer number between 0 and 1000, inclusive. Notice that you need to extract individual digits from the input number using the remainder (modulus) and division mathematical operators.
For example, if the input number is 123, the sum of its digits is 6. Document your code and properly label the input prompts and the outputs as shown below.
Sample run 1:
Entered number: 123 Sum of digits: 6
Sample run 2:
Entered number: 588 Sum of digits: 21
Sample run 3:
Entered number: 100 Sum of digits: 1
Program 3: Distance calc. This question is fairly straightforward. Design (pseudocode) and implement (source code) a program to compute the distance between 2 points. The program prompts the user to enter 2 points (X1, Y1) and (X2, Y2). The distance between 2 points formula is:
Square_Root [(X2 - X1)^2 + (Y2 - Y1)^2]
Document your code, properly label the input prompts, and organize the outputs as shown in the following sample runs. Note: for C++, #include <math.h> and then call sqrt(). For Java, you'll use Math.sqrt() and for C# it's Math.Sqrt(). See the short appendix below for the general form.
Sample run 1: Entered X1: 1.5
Entered Y1: -3.4
Entered X2: 4
Entered Y2: 5
Distance: 8.764131445842194
Sample run 2: Entered X1: -5.5
Entered Y1: -8.8
Entered X2: 25
Entered Y2: 4.5
Distance: 33.27371334852784
Sample run 3: Entered X1: 2
Entered Y1: 2
Entered X2: 10
Entered Y2: 10
Distance: 11.313708498984761
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 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! Sample run 2:
Enter the flight distance: 500
Enter the current cost of jet fuel: $3 The flight will cost $7500.0 in fuel. Enter the number of passengers: 500 Enter the average cost of a ticket: 300 You will make a profit of $142500.0
You averaged 100.0 miles per person per gallon!
Sample run 3:
Enter the flight distance: 4200
Enter the current cost of jet fuel: $1.80 The flight will cost $37800.0 in fuel.
Enter the number of passengers: 550 Enter the average cost of a ticket: 600 You will make a profit of $292200.0
You averaged 110.0 miles per person per gallon!
Note: Need this assignment in C# language
Attachment:- Type Systems and Expressions.rar