This assignment will let me know if you have less than, greater than or equal to 50 cents in your pocket. Assuming the value you pulled out of your pocket is less than $1.00
• In the main code, create 3 variables, 1st one will be "hard coded", meaning it will always have the same value when the program is ran. 2nd value is a value you input into the computer, 3rd value is a random number generated by the computer from 1-99.
• Define multiple functions in the code howMuch, greater50, less50, equal50
• Each function print out a statement if the change is less than, greater than or equal 50 cents
If you have any doubts please comment below.
Java Code: cents.java
import java.util.*;
public class cents
{
//main function
public static void main(String[] args) {
//centsFirst is already initialized
int centsFirst = 50,centsSecond,centsThird;
//Scanner to read user input
Scanner sc = new Scanner(System.in);
System.out.println("Enter amount between 1 to 99 cents");
//user input cents
centsSecond = sc.nextInt();
Random r = new Random();
//random generated cents
centsThird = r.nextInt(99)+1;
//method call howMuch
howMuch(centsFirst);
howMuch(centsSecond);
howMuch(centsThird);
}
//print cents and calculate greater than 50 or less50 or equal to
50
public static void howMuch(int cents){
//print cents
System.out.println("Cents "+cents);
//cents greater than 50
if(cents>50)
greater50(cents);
//cents equal to 50
else if(cents==50)
equal50(cents);
//cents less than 50
else
less50(cents);
}
//print greater than
public static void greater50(int cents){
System.out.println("Cents "+cents+" is greater than 50");
}
//print less than 50
public static void less50(int cents){
System.out.println("Cents "+cents+" is less than 50");
}
//print equal to 50
public static void equal50(int cents){
System.out.println("Cents "+cents+" is equal than 50");
}
}
This assignment will let me know if you have less than, greater than or equal to...
This assignment will let me know if you have less than, greater than or equal to 50 cents in your pocket. Assuming the value you pulled out of your pocket is less than $1.00 • In the main code, create 3 variables, 1st one will be "hard coded", meaning it will always have the same value when the program is ran. 2nd value is a value you input into the computer, 3rd value is a random number generated by the computer...
1st blank options: equal to /
less than / greater than
2nd blank options: not reacting completely / acting as an
electrophile / becoming fully protonated
3rd blank options: reprotonating the phenol / not reacting
completely / acting as the nucleophile
Question 5 Status: Not yet answered Points possible: 1.00 In a Williamson ether synthesis, you start by adding a base like methoxide to deprotonate a phenol so the deprotonated phenolate can act as a nucleophile. The moles of base...
An F statistic can have what values? 1). less than or equal to zero 2). greater than or equal to zero 3). greater than zero 4). greater than or less than zero less than zero
Java: Write the condition to determine if value is less than 99,999 or value is greater than 5,000. You do not have to worry about putting the triangle I want just the code that would go inside the box.
Choices: Greater than, less than, or equal
Asteroids X, Y, and Z have equal mass of 5.0 kg each. They orbit around a planet with M-6.20E+24 kg. The orbits are in the plane of the paper and are drawn to scale. Im Lu In the statements below, TE is the total mechanical energy, KE is the kinetic energy, and PE is the potential energy. The PE of X at m is the PE of Y at i The TE of...
3-How would you write the following using C code? X is equal to Y (comparing X and Y not setting X to the value of Y) X is not equal to Y A is less than or equal to B Q is not greater than T X is greater than or equal to Y X is less than or equal to Y and A is not equal to B A is greater than 18 and H is greater than 68...
Consider a value to be significantly low if its z score less than or equal to - 2 or consider a value to be significantly high if its z score is greater than or equal to 2. A data set lists weights (grams) of a type of coin. Those weights have a mean of 5.36344 g and a standard deviation of 0.05415g. Identity the weights that are significantly low or significantly high. What weights are significantly low Select the correct answer below...
You are given the initial value problem Approximate the solution with error less than or equal to 10-10 on 0sts 2 using a method other han a higher-order Taylor method. Print out your solution in increments of h 0.1. Comment on why you chose the method you used, and why you are confident the error is within the specified tolerance.
You are given the initial value problem Approximate the solution with error less than or equal to 10-10 on 0sts...
2. Greater than, equal to,
less than
Place a black point (plus symbol) on the graph to indicate the long-run monopolistically competitive equilibrium price and quantity for this firm. Next, place a grey point (star symbol) to indicate the minimum average total cost the firm faces and the quantity associated with that cost. Mon Comp Outcome Min Unit Cost PRICE (Dollars per jacket) ATC МС - P > ATC MR Demand 0 10 90 100 MR = MC 20 30...
POSITION VELOCITY AND ACCELERATION You have three functions where t is greater than or equal to zero: Position s(t)= -5cost Velocity = 5sint Acceleration = 5cost How fast is the edge of the board moving after 2 seconds? Based on your graph, over what intervals is the edge of the diving board moving upward?