Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The distance form Cameron to Epic is 1 mile. The shuttle bus arrives on the five

ID: 3782907 • Letter: T

Question

The distance form Cameron to Epic is 1 mile. The shuttle bus arrives on the fives in front of the Cameron. The bus travels at 5 mph. Your class prior to this one ends at 12:15 pm. If you walk you can travel at 4 mph. Write the program that includes the following: A calculation that outputs how many minutes it will take to walk to class A calculation that outputs how many minutes it will take to arrive via bus Asks the user to input the source of transportation that takes the least amount of time and outputs "You should to get to class on time." (alter as necessary) Each member of the group must participate in the program development and should understand every line of the program. The program must have comments at significant points within the code.

Explanation / Answer

program to calculate how many minutes it will take to walk to class.

code in c,

use the formula s = ut + 1/2 at2

u = 4 mph , a =0

#include <stdio.h>

int main()

{

int u = 4 ;

int s = 1;

float time;

printf("time taken in minutes %f",time);

return 0;

}

----------------

minutes via bus

similar to above with u = 5

#include <stdio.h>

int main()

{

int u = 5 ;

int s = 1;

float time;

time = (s/u)*60;

printf("time taken in minutes %f",time);

return 0;

}

----------------

#include <stdio.h>

int main()

{

int u = 4 ;

int s = 1;

float time;

printf("time taken in minutes %f",(s/u)*60);

return 0;

}

----------------

this question is slightly ambiguosu , i assume that we have to take the transportation that the user enters as the one which is taking the least time and not the one mathematically.

code --

#include <stdio.h>

int main()

{

char choice[100];

printf("Enter the means of transporation which is fastest---");

scanf("%s",choice);

printf("You should %s to get to class on time ",choice);

return 0;

}

----------------

thank you

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote