Java Programming
Java Programming
9th Edition
ISBN: 9780357238530
Author: Joyce Farrell
Publisher: Cengage Limited
bartleby

Concept explainers

Question
Book Icon
Chapter 12, Problem 4PE
Program Plan Intro

Program Plan

1. Variables mentioned below are used:

  • arrSize- the size of the array as the input given by the user.
  • values[]- which has the series of numbers to be sorted
  • input- double number entered as input by the user
  • avgValue − an average of all the numbers entered as input
  • exitVal- exit code to quit the reading of input from the console.
  • sum- the sum of all the entered numbers and is used to calculate the average of numbers.
  • arrCreateStatus − a boolean value that decides whether to create an array with user-entered sized.
  • valid- boolean value that holds the status of reading input from the console.

2. Functions mentioned below are used:

  • main()- Main function of the program which gets the input and displays the output.

Blurred answer
Students have asked these similar questions
Write an application that displays a series of at least five student ID numbers (that you have stored in an array) and asks the user to enter a numeric test score for the student. Create a ScoreException class, and throw a ScoreException for the class if the user does not enter a valid score (less than or equal to 100). Catch the ScoreException and then display an appropriate message. In addition, store a 0 for the student's score. At the end of the application, display all the student IDs and scores. Save the files as ScoreException.java and TestScore.java.
this practice assignement wants me to Write an application that contains an array of 10 multiple-choice quiz questions related to your favorite hobby. Each question contains three answer choices. Also create an array that holds the correct answer to each question—A, B, or C. Display each question and verify that the user enters only A, B, or C as the answer—if not, keep prompting the user until a valid response is entered. If the user responds to a question correctly, display Correct!; otherwise, display The correct answer is and the letter of the correct answer. After the user answers all the questions, display the number of correct and incorrect answers here is my new code! i need help to get it to working : import java.util.*;public class Quiz {public static void main(String args[]){String questions[]=("1.What is my favorite hobby?\n" + "(a)hair\n(b)makeup\n(c)both a and b\n", "2.Who first discovered makeup?\n" +"(a)Egyptians\n(b)haitians\n(c)Africans", "3.What glue is best to use…
Make an application that displays a series of at least five student ID numbers (that you have stored in an array) and asks the user to enter a numeric test score for the student. Make a ScoreException class, and throw a ScoreException for the class if the user does not enter a valid score (less than or equal to 100). Catch the ScoreException, display the message Score over 100, and then store a 0 for the student's score. At the end of the application, display all the student IDs and scores.   public class ScoreException extends Exception {    public ScoreException(String s) {    } }     import java.util.*; public class TestScore {    public static void main(String args[]) throws Exception {        Scanner input = new Scanner(System.in);        int[] ids = {1234, 2345, 3456, 4567, 5678};        int[] scores = {0, 0, 0, 0, 0};        String scoreString = new String();        final int HIGHLIMIT = 100;        String inString, outString = "";        for (int x = 0; x < ids.length; ++x)…
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage