1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
GaryK [48]
2 years ago
11

in java write an application that asks a user to type an even number or the sentinel value 999 to stop. When the user types an e

ven number, display the message "Good job!" and then ask for another input. When the user types an odd number, display an error message, "x is not an even number", and then ask for another input. When the user types the sentinel value 999, end the program
Computers and Technology
1 answer:
dangina [55]2 years ago
3 0
Add 1 to make it an even number
You might be interested in
What role do chromosomes play in inheritance?
Minchanka [31]

Each gene occupies a specific position on a chromosome. Because genes provide instructions for making proteins, and proteins determine the structure and function of each cell in the body, it follows that genes are responsible for all the characteristics you inherit.

8 0
3 years ago
Which of the following is the best example of potential energy?
Otrada [13]
<span>Potential energy is the energy that is stored in an object due to its position relative to some zero position ,so the answer is " A runner positioned at the start line"</span>
6 0
3 years ago
Read 2 more answers
Write a static method named lowestPrice that accepts as its parameter a Scanner for an input file. The data in the Scanner repre
NikAS [45]

Answer:

Explanation:

The following code is written in Java. It creates the method as requested which takes in a parameter of type Scanner and opens the passed file, reads all the elements, and prints the lowest-priced element in the file. A test case was done and the output can be seen in the attached picture below.

import java.io.File;

import java.io.FileNotFoundException;

import java.util.Scanner;

class Brainly{

   public static void main(String[] args) throws FileNotFoundException {

       Scanner console = new Scanner(System.in);

       System.out.print("file location: ");

       String inputLocation = console.next();

       File inputFile = new File(inputLocation);

       Scanner in = new Scanner(inputFile);

       lowestPrice(in);

   }

   public static void lowestPrice(Scanner in) {

       double smallest = in.nextDouble();

       while(in.hasNextDouble()){

           double number = in.nextDouble();

           if (number < smallest) {

               smallest = number;

           }

       }

       System.out.println(smallest);

       in.close();

   }

}

6 0
3 years ago
Brianna Watt, a consultant doing business as Watt Gives, wants a program to create an invoice for consulting services. Normally,
GREYUIT [131]

Answer:

The pseudocode is as follows:

Total_Hours = 0

Input Client_Name

Rate = 30.00

For days = 1 to 5

      Input Hours_worked

      Total_Hours = Total_Hours + Hours_Worked

Charges = Rate * Total_Hours

Print "Brianna Watt"

Print Client_Name

Print Total_Hours

Print Rate

Print Charges

Explanation:

This initializes the total hours worked to 0

Total_Hours = 0

This gets input for the client name

Input Client_Name

This initializes the standard rate to 30.00

Rate = 30.00

This iterates through the 5 days of work

For days = 1 to 5

This gets input for the hours worked each day

      Input Hours_worked

This calculates the total hours worked for the 5 days

      Total_Hours = Total_Hours + Hours_Worked

This calculates the total charges

Charges = Rate * Total_Hours

This prints the company name

Print "Brianna Watt"

This prints the client name

Print Client_Name

This prints the total hours worked

Print Total_Hours

This prints the standard rate

Print Rate

This prints the total charges

Print Charges

7 0
3 years ago
What is displayed in the alert dialog box after the following code is executed? var scores = [70, 20, 35, 15]; scores[scores.len
kvv77 [185]

Answer:

The scores array: 70,20,35,15,40

Explanation:

I will explain the code line by line:

var scores = [70, 20, 35, 15];  

The above statement declares and assigns values to an array named scores

scores[scores.length] = 40;  

The above statement uses length to set the length of the scores array. It sets the last element of the scores array to 40. So this means 40 is set as the last element of scores.

scores.length returns the length of the scores array i.e. 4 as there are 4 elements in scores array 70,20,35,15

So the statement becomes:

scores[4] = 40;

This assigns value 40 to the 4th index of the scores array. Do not confuse 4th index with 4th element of the array because array element location starts from 0. So scores[4] does not mean 4th element but scores[4] means 4th index position of scores array. This makes 5th element of scores. So set the element 40 as 5th element at 4th index of scores.

alert("The scores array: " + scores);

This displays an alert box with the following message:

The scores array: 70,20,35,15,40

4 0
3 years ago
Other questions:
  • What does computer means?
    9·2 answers
  • My tv is hdtv but it does not show the name of the channels
    15·1 answer
  • What is the name of the computer through which e-mail messages are sent and received?
    12·1 answer
  • Technological progress has reduced the cost of manufacturing mp3 players. what happens if demand is unchanged?
    9·1 answer
  • What observations can you make about any of these data structures ? Go into as much as you can. Try proposing your own data stru
    8·1 answer
  • प्रश्न-20 उचित स्थान पर विराम चिह्न लगाइए
    8·1 answer
  • Write a Python program that prints all the numbers from 0 to 6 except 3
    8·1 answer
  • What are LinkedIn automation tools used for?
    14·1 answer
  • 4. Arnold curates articles that feature trending lists for an online website. His department is responsible
    5·1 answer
  • Business Rules constraints falls into two categories:
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!