Question
this is the qestion it has to be in java
y Booleato Tools Window Help Hesustor X C C CB https:/class.mimiloassignments/e645f0d9-8eb-4d9b-818-6bb684bBeb/do/90db2810 O
Example
of what i need
Debugging Information for Test Case 1 PROGRAM BICUTON STAGE TRACE None INPUT OF THE TEST CASE 245. 78.75 767.5 10.65 YOUR COD
0 0
Add a comment Improve this question Transcribed image text
Answer #1

If you have any doubts, please give me comment...

import java.util.InputMismatchException;

import java.util.Scanner;

public class MaxMinGrades{

    public static void main(String[] args) {

        Scanner scnr = new Scanner(System.in);

        System.out.println("Enter as many student grades as you like. Enter a character to stop.");

        double highest = Double.MIN_VALUE;

        double lowest = Double.MAX_VALUE;

        double input;

        while(scnr.hasNextDouble()){

            input = scnr.nextDouble();

            if(highest<input)

                highest = input;

            if(lowest>input)

                lowest = input;

        }

        scnr.next();

        System.out.println("The highest grade is: "+highest);

        System.out.println("The lowest grade is: "+lowest);

    }

}

nagarajuanagaraju-Vostro-3550:27092019$ javac MaxMinGrades.java, nagarajuanagaraju-Vostro-3550:27092019$ java MaxMinGrades En

Add a comment
Answer #2

Answer:

Code:

import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner r = new Scanner(System.in);
float max = 0, min = 999999,f;
String inp; boolean b=true;
System.out.println("Enter as many grades you want. Enter a character to stop.:");
do{
inp = r.nextLine();
try {
f=Float.parseFloat(inp);
}
catch (NumberFormatException e)
{
break;
}
min=min<f?min:f;
max=max<f?f:max;
}while (b);
System.out.println("The highest grade is : " + max);
System.out.println("The lowest grade is : " + min);
}
}

Output:

input Enter as many grades you want. Enter a character to stop.. 12 56.4 23.5 78 84 The highest grade is : 84.0 The lowest gr

Indentation:

1 2 import java.util.Scanner; public class Main muno69299 public static void main(String[] args) { Scanner r = new Scanner(Sy

Add a comment
Know the answer?
Add Answer to:
this is the qestion it has to be in java Example of what i need y...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a program that prompts the user for student grades and displays the highest and lowest grades in the class.

    Write a program that prompts the user for student grades and displays the highest and lowest grades in the class. The user should enter a character to stop providing values.example Enter as many student grades as you like. Enter a character to stop. The highest grade is: 92.0 The lowest grade is: 10.65# in java

  • Write a JAVA program that prompts the user for student grades and displays the highest and...

    Write a JAVA program that prompts the user for student grades and displays the highest and lowest grades in the class. The user should enter a character to stop providing values. Starter code: import java.util.Scanner; public class MaxMinGrades{   public static void main(String[] args){     Scanner input = new Scanner(System.in);     System.out.println("Enter as many student grades as you like. Enter a character to stop.");     double grade = input.nextDouble();     double minGrade = Double.MAX_VALUE;     double maxGrade = Double.MIN_VALUE;     while (Character.isDigit(grade)) {       if (grade == 0)...

  • I need to change the following code so that it results in the sample output below...

    I need to change the following code so that it results in the sample output below but also imports and utilizes the code from the GradeCalculator, MaxMin, and Student classes in the com.csc123 package. If you need to change anything in the any of the classes that's fine but there needs to be all 4 classes. I've included the sample input and what I've done so far: package lab03; import java.util.ArrayList; import java.util.Scanner; import com.csc241.*; public class Lab03 { public...

  • I need help writing a pseudocode: JAVA Write a pseudocode algorithm that asks the user for...

    I need help writing a pseudocode: JAVA Write a pseudocode algorithm that asks the user for their grades in CSE 1321, along with their attendance, then calculates their final grade. Note, perfect attendance rounds up your final grade by 1.5 points – otherwise, it’s a fraction out of 30. The tests and quiz average are worth 20% each. Sample Output: Enter your grade for Test 1: 95 Enter your grade for Test 2: 85 Enter your grade for Test 3:...

  • psuedocode and raptor flow chart- i need the basic psuedocode and raptor flow chart with reverse...

    psuedocode and raptor flow chart- i need the basic psuedocode and raptor flow chart with reverse loop logic. For this program, you will calculate a student's average for a semester. The student has earned 6 test grades during the semester, and their average is calculated after removing the lowest grade from the scores. Write a program that asks the user to enter the six grades and stores them in an array. Then, search the array for the lowest value and...

  • using java Program: Please read the complete prompt before going into coding. Write a program that...

    using java Program: Please read the complete prompt before going into coding. Write a program that handles the gradebook for the instructor. You must use a 2D array when storing the gradebook. The student ID as well as all grades should be of type int. To make the test process easy, generate the grade with random numbers. For this purpose, create a method that asks the user to enter how many students there are in the classroom. Then, in each...

  • I need to create a code for this prompt: In this project we will build a...

    I need to create a code for this prompt: In this project we will build a generic UserInput class for getting keyboard input from the user. Implementation: The class UserInput is a 'Methods only' class, and all the methods should be declared static. Look at the TestScanner.java program at the bottom of this page that inputs a string, int and double. It shows you how to use Scanner class to get input from the keyboard. Write FOUR simple methods, one...

  • I ONLY need question 2 part C AND D answered...it is in bold. Please do not...

    I ONLY need question 2 part C AND D answered...it is in bold. Please do not use hash sets or tables. In java, please implement the classes below. Each one needs to be created. Each class must be in separate file. The expected output is also in bold. I have also attached the driver for part 4 to help. 1. The Student class should be in the assignment package. a. There should be class variable for first and last names....

  • Please help. I need a very simple code. For a CS 1 class. Write a program...

    Please help. I need a very simple code. For a CS 1 class. Write a program in Java and run it in BlueJ according to the following specifications: The program reads a text file with student records (first name, last name and grade). Then it prompts the user to enter a command, executes the command and loops. The commands are the following: "printall" - prints all student records (first name, last name, grade). "firstname name" - prints all students with...

  • I'm falling behind on my hw and I can really use a hand with using structures...

    I'm falling behind on my hw and I can really use a hand with using structures in C,++ C++ Object Oriented Programming Programming Assignment #4 Structures Create a structure representing a student. The member variables should include student name, student ID, and four test grades for the student (an array of four grades as a member variable). Prompt the user to enter the name, ID and the four test results. Store all the data in the structure. Calculate the average...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT