Preview

become a good journalist and a doctor

Satisfactory Essays
Open Document
Open Document
296 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
become a good journalist and a doctor
11. Write a program that allows the user to enter students’ names followed by their test scores and outputs the following information (assume that maximum number of students is 50): a. The average score.
b. Names of all students whose test scores are below the average, with an appropriate message.
c. Highest test score and the name of all students having the highest score. Use two arrays to store the student names and scores respectively and then manipulate the array contents. import java.util.Scanner;
// for double formatting import java.text.DecimalFormat; public class StudentScore
{
//--------------------------------------------------------- // Calculate student score and basic report //--------------------------------------------------------- public static void main(String[] args) { // an array of double to store student's score double [] studentscore = new double[50]; // an array of String object to store student name String [] studentname = new String[50]; double studentavg = 0.0, sumscore = 0.0, averagescore = 0.0, highestscore =0.0; // index int i = 0, j = 0, k = 0, counter = 1; Scanner readname = new Scanner(System.in); Scanner readscore = new Scanner(System.in); // prompt for inputs: Student name and score System.out.println("Enter student name and score, 'Q' & 0 to stop: "); // read and store student name and score for 1st input... studentname[i] = readname.nextLine(); studentscore[i] = readscore.nextDouble(); // read and store next student name and score do { i++; counter++; System.out.println("Enter student name and score, 'Q/q' & 0 to stop: "); studentname[i] = readname.nextLine(); studentscore[i] = readscore.nextDouble(); // until the Q or q and 0 are entered... }

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Step 2: Think of good variable names for the following pieces of data that will need to be stored with in this program.…

    • 777 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Answer all the questions in Part A on the answer sheet provided, using pencil . only: Print your student number, name and initials in the space provided and mark…

    • 472 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    The purpose of this Lab. is to familiarize student how to solve practical problems programmatically; they will practice on elementary programming using primitive data types, variables, constants, operators, expressions, and input and output. Also, they will learn how to diagnose errors that may occur when a program is compiled or executed. There are some exercises, through which they will understand the concept learn in this chapter.…

    • 2338 Words
    • 10 Pages
    Powerful Essays
  • Good Essays

    ElizabethFlaimFP

    • 1289 Words
    • 7 Pages

    Objective: Devise a program that will allow a user to input a list of family members with their age and state where they live. Once the list is complete, the program will calculate and print the average age of the user’s family and also print the names of any family members that live in Texas. All three items, the input, average, and printing family members from Texas will require the use of repetitive programming statements/loops.…

    • 1289 Words
    • 7 Pages
    Good Essays
  • Satisfactory Essays

    Pt1420 Unit 7 Study Guide

    • 582 Words
    • 3 Pages

    21. Write a program that prompts the user to enter two unsigned numbers 0 to FFFFh and their sum in hex on the next line.…

    • 582 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Display the contents of the file GRADES created in Problem 1. Each student’s record should appear on a separate line and include the total score (the sum of the three tests) for that student. For example a line output might be:…

    • 349 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Gbs603 Unit 3 Assignment 1

    • 6339 Words
    • 26 Pages

    Blackboard 3 3. Student Email 3 GENERAL COURSE INFORMATION 3 4. Brief Course Description 3 5. Assumed Knowledge 4 6.…

    • 6339 Words
    • 26 Pages
    Satisfactory Essays
  • Satisfactory Essays

    B. Describe what was done. The student’s was to give information on when and where they were born. Randi asked the student to grade the information according to the correct by a show of hands. On a scale from 1 to 5; therefore, 5 being the most accurate for the information provided. Randi asked each student to pass their papers over their shoulder to the person behind them. Students on the back row had to bring their paper up to the person on the front row. Randi asked the students to open and read the other person horoscope. The results were all the students had received the same horoscope.…

    • 808 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    c. Modify the program of Part b so that at the option of the user, it displays…

    • 300 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    It 210 Week 7

    • 286 Words
    • 2 Pages

    2. Display the contents of the file GRADES created in Problem 1. Each student’s record should appear on a separate line and include the total score (the sum of the three tests) for that student. For example, a line of output might be as follows:…

    • 286 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    CMIS 102 Homework 3

    • 342 Words
    • 3 Pages

    Program Description - This program will allow a user to input their name and final grades from their courses and calculate their GPA accordingky. The amount of students as well as the amount of classes each student is taking, are undetermined.…

    • 342 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    4: Suppose that a school places students in specific "ability groups" on the basis of test scores and other criteria. This reflects the practice of…

    • 1533 Words
    • 7 Pages
    Powerful Essays
  • Satisfactory Essays

    4. If you were preparing a spreadsheet to share information about the names of students and their grades on a test, how would you organize the information into rows and columns? Give at least one reason to explain your answer. Explain in 2-5 sentences. (3.0 points)…

    • 344 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    A. The SAT test applicants who score higher tend to be the students who are in upper class families because they can afford to pay for the expensive tutoring that is extremely beneficial.…

    • 1821 Words
    • 8 Pages
    Powerful Essays
  • Good Essays

    Hippocrates, the father of modern medicine, once stated, “If we could give every individual the right amount of nourishment and exercise, not too little and not too much, we would have found the safest way to health” (Buford et al 157). Hippocrates words support the importance of good health. A career in Health and Exercise Science is important in promoting optimum health in an individual or population.…

    • 775 Words
    • 3 Pages
    Good Essays