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

I need help getting started. I do fine reading and understanding code but for so

ID: 3883694 • Letter: I

Question


I need help getting started. I do fine reading and understanding code but for some reason I go blank at a white screen! help please!!

Clipboard Font Paragraph ral Styles People Pages Flles Syllabus Chae . Previoun EGR 140: Computer Programming Assignment # 6 Assigned: Monday, 11 September 2017 Due: Friday, 15 September 2017 Points: 20 Write an error-free Java program to do the following things. 1. Generate a table of conversions from Miles Per Hour (MPH) to meters per second (m/s) for values from a min MPH value up to a max MPH value of 140. Display a line in the table for each 5 MPH The min MPH value needs to be input from the user. Assume that it will be a positive integer and it will be a multiple of 5. 2. Calculate the average of the m's values in your table. Display the total number of entries in your table and the average m/s at the end of the table. (You must calculate the average within your program; ie., do not calculate the average on a calculator and then display the value.) 3. 4. Include a table heading and column headings in your print out. There is a formatting symbol ("t") that can be used in println statements that will tab over. For next formatting of output, I suggest (but not require) that you use printfo. 5. You must use at least one while statement in your program. Sample output Gust the first few lines are shown): | Input min MPH value: 10 Page 1 of 2 275 words L

Explanation / Answer

/*

Sample Output

*/

import java.util.Scanner;
class Main
{
public static void main(String[] args)
{
// declaring variables
Scanner sc = new Scanner(System.in);
int min,mps, totalmps = 0, count=0;
  
//taking user input of min value
System.out.print("Input min MPH value:");
min = sc.nextInt();
  
System.out.println("--------------- MPH MPS");
  
// checking for the condition and looping
while(min<=140)
{
// to pring line
if(count%5 == 0)
{
System.out.println("---------------");
}
  
// converting to mps, math for average and incrementing count
mps = (min*60*60);
totalmps += mps;
count++;
  
// printing output of conversion
System.out.printf("%d %d ",min,mps);
min +=1;
}
  
// printing average and count
System.out.printf("--------------- Average m/s is %f ", totalmps/(count*1.0));
System.out.printf("Total number of entries are %d",count);
}
}

/*

Sample Output

  Input min MPH value: 10  ---------------  MPH     MPS  ---------------  10      36000  11      39600  12      43200  13      46800  14      50400  ---------------  15      54000  16      57600  17      61200  18      64800  19      68400  ---------------  20      72000  21      75600  22      79200  23      82800  24      86400  ---------------  25      90000  26      93600  27      97200  28      100800  29      104400  ---------------  30      108000  31      111600  32      115200  33      118800  34      122400  ---------------  35      126000  36      129600  37      133200  38      136800  39      140400  ---------------  40      144000  41      147600  42      151200  43      154800  44      158400  ---------------  45      162000  46      165600  47      169200  48      172800  49      176400  ---------------  50      180000  51      183600  52      187200  53      190800  54      194400  ---------------  55      198000  56      201600  57      205200  58      208800  59      212400  ---------------  60      216000  61      219600  62      223200  63      226800  64      230400  ---------------  65      234000  66      237600  67      241200  68      244800  69      248400  ---------------  70      252000  71      255600  72      259200  73      262800  74      266400  ---------------  75      270000  76      273600  77      277200  78      280800  79      284400  ---------------  80      288000  81      291600  82      295200  83      298800  84      302400  ---------------  85      306000  86      309600  87      313200  88      316800  89      320400  ---------------  90      324000  91      327600  92      331200  93      334800  94      338400  ---------------  95      342000  96      345600  97      349200  98      352800  99      356400  ---------------  100     360000  101     363600  102     367200  103     370800  104     374400  ---------------  105     378000  106     381600  107     385200  108     388800  109     392400  ---------------  110     396000  111     399600  112     403200  113     406800  114     410400  ---------------  115     414000  116     417600  117     421200  118     424800  119     428400  ---------------  120     432000  121     435600  122     439200  123     442800  124     446400  ---------------  125     450000  126     453600  127     457200  128     460800  129     464400  ---------------  130     468000  131     471600  132     475200  133     478800  134     482400  ---------------  135     486000  136     489600  137     493200  138     496800  139     500400  ---------------  140     504000  ---------------    Average m/s is 270000.000000  Total number of entries are 131      

*/

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