Java Programming. Please make sure program compiles, the code is copyable, and screenshots of the output are provided for 5 stars :-) Calculation for speed is just supposed to be google searched
Program code:
import java.util.*;
public class SpeedCalc
{
private static final double foot_to_miles = 0.000189394;
private static final double inch_to_foot = 0.0833333;
public static void main(String []args)
{
Scanner s = new Scanner(System.in);
float[] dia = new float[10];
float[] ratio = new float[10];
float[] rotation = new float[10];
float[] speed = new float[10];
int n,i=1;
boolean set=true;
System.out.print("Enter n: ");
n=s.nextInt();
while(i<=n)
{
while(set)
{
System.out.print("\nEnter the value of Wheel diameter : ");
float val = s.nextFloat();
if (val>=10 && val<=50)
{
dia[i] = val;
set=false;
}
else
System.out.print("\nNot valid.\nTry again.\n");
}
set=true;
while(set)
{
System.out.print("\nEnter the value of Bike-to-pedal ratio : ");
float val = s.nextFloat();
if (val>=0.1 && val<=10)
{
ratio[i] = val;
set=false;
}
else
System.out.print("\n nNot valid.\nTry again.\n");
}
set=true;
while(set)
{
System.out.print("\nEnter the value of Pedal rotations per minute : ");
float val = s.nextFloat();
if (val>=1 && val<=120)
{
rotation[i] = val;
set=false;
}
else
System.out.print("\n nNot valid.\nTry again.\n");
}
set=true;
i=i+1;
}
for(int c=1; c<=n; c++)
{
speed[c] = (float) (((dia[c]*foot_to_miles)*inch_to_foot*Math.PI)*ratio[c]*rotation[c]*60);
}
System.out.println(" \nWheel diameter Bike-to-pedal ratio Pedal Rotations per minute speed");
for(int k=1; k<=n; k++)
{
System.out.println("\t"+dia[k]+"\t\t"+ratio[k]+"\t\t"+rotation[k]+"\t\t\t"+speed[k] );
}
}
}
Java Programming. Please make sure program compiles, the code is copyable, and screenshots of the output...
Please make a JAVA program for the following using switch structures Write a program that simulates a simple Calculator program. The program will display menu choices to the user to Add, Subtract, Multiply and Divide. The program will prompt the user to make a selection from the choices and get their choice into the program. The program will use a nested if….else (selection control structure) to determine the user’s menu choice. Prompt the user to enter two numbers, perform the...
Java BasketBall Bar Chart Write a program that allows you to create a bar chart for the active members of a basketball team during a game. (Recall: there are only 5 active players on the court per team in a standard basketball game.) Your program should do the following tasks: 1) Prompt the user to store the first name of the five players 2) Prompt the user to enter the points scored by each player a. Use a do...while loop...
C++ Assignment 4 - Robot Speed Estimator Be sure to read through Chapter 7 Structured Data and Classes before starting this assignment. Your job is to write a program to estimate the speed of a robot. Your program will use a class called Robot to represent a robot. To keep things simple, this class will focus only on one aspect of a Robot - the maximum speed at which it can move. Background The speed of the robot is largely...
MAKE SURE YOU TEST THE PROGRAM FISRT. DON'T PUT THE CODE WITHOUT TESTING. MAKE SURE ALL THE STEPS ARE FOLLOWED IN CORRECT MANNER ONLY USE VISUAL STUDIO C# CONSOLE APPLICATION Use File IO (NO JAVA CODING) Create a C# Console program that will demonstrate the use of File IO, Arrays, and Classes. This assignment has a number of requirements. Carefully read the document and note all the requirements. Also keep in mind that many of the requirements for this assignment...
please put the comment each line, make sure i will have output too. write a program, Summarize (Summarize.java), containing the main() method, that first writes 10,000 random positive double type numbers, to the full accuracy of the number (15/16 decimal places), to a text file named DataValues.txt, one number per line. The program must then close that file, and reopen it for reading. Read back the values from the file and write the following information to a file named Summary.txt:...
Please help with Java programming! This code is to implement a Clock class. Use my beginning code below to test your implementation. public class Clock { // Declare your fields here /** * The constructor builds a Clock object and sets time to 00:00 * and the alarm to 00:00, also. * */ public Clock() { setHr(0); setMin(0); setAlarmHr(0); setAlarmMin(0); } /** * setHr() will validate and set the value of the hr field * for the clock. * *...
In JAVA Chapter 5Assignment(Rock, Paper, Scissors)–20pointsYour goal is towrite a program that lets the user play the game of Rock, Paper, Scissors against the computer.Your program should have the following: •Make the name of the project RockPaperScissors•Write a method that generates a random number in the range of 1 through 3. The randomly generated number will determine if the computer chooses rock, paper, or scissors. If the number is 1, then the computer has chosen rock. If the number is...
PLEASE WRITE CODE FOR C++ ! Time Validation, Leap Year and Money Growth PartA: Validate Day and Time Write a program that reads a values for hour and minute from the input test file timeData.txt . The data read for valid hour and valid minute entries. Assume you are working with a 24 hour time format. Your program should use functions called validateHour and validateMinutes. Below is a sample of the format to use for your output file timeValidation.txt : ...
Java Project In Brief... For this Java project, you will create a Java program for a school. The purpose is to create a report containing one or more classrooms. For each classroom, the report will contain: I need a code that works, runs and the packages are working as well The room number of the classroom. The teacher and the subject assigned to the classroom. A list of students assigned to the classroom including their student id and final grade....
Please can someone help me to finish this program? It is a C programming not a C++, when programming the program in linux I keep getting expected expression before || token, also please check if everything else is fine, maybe there is something else worng in my program and may ask me later to fix it, I am concern about the sin and cosine. The program is supposed to do all this: 1.Display a welcome message. 2.Prompt for the height...