0
FLIGHT TIME
You need to calculate the flight time of an upcoming trip. You are flying from LA to Sydney, covering a distance of 7425 miles, the plane flies at an average speed of 550 miles an hour. Calculate and output the total flight time in hours. I CANT UNDERSTAND HOW I WRITE THE PROGRAM PLEASE HELP ME
16 odpowiedzi
+ 7
PUSHPANJALI
Nice attempt.
Your first line uses floor// which gets rid of residual division.
Your second line uses modular which only returns the residual.
So using your system you could write the following.
num = 7425//550
decimal = 7425 %550
print(num + decimal)
or you could use the division operator
print(7425/550)
+ 4
PUSHPANJALI
If you can tell me the mathematical equation to solve this problem, then I can tell you how to write the program.
+ 4
The basic concept of coding is problem solving.
You have identified that your math is lacking, so to fix this you must learn how to do this math.
Asking for answers to all your problems will not get you far in life, and this is basic math.
+ 4
Please post your code attempt so I may review
+ 4
PUSHPANJALI
If you can show the Sololearn community that you have tried to solve this yourself, then everybody who reviews these questions will try to help you.
That is why I asked for you to post your attempt.
+ 3
Thank you sir
+ 2
I hope next time you always help me and explaining, and solving the problem
+ 1
I am not good in math and that's reason I can't understand how to solve this program
+ 1
I know but I trying and I am solving this program but they are said its wrong...I don't know how I solve this problem
+ 1
print(7425 // 550)
And I try
print( 7425 % 550)
+ 1
Just do a simple division 7425/550
0
Ok
0
#include <iostream>
using namespace std;
int main()
{
int D =7425;
int S = 550;
int T= D/S
cout << D << end1;
return 0;
}
0
Answer:
print(7425 / 550)
- 1
Ok