answer.
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
Mashcka [7]
2 years ago
14

Given a int variable named yesCount and another int variable named noCount and an int variable named response write the necessar

y code to read a value into into response and then carry out the following: if the value typed in is a 1 or a 2 then increment yesCount and print out "YES WAS RECORDED" if the value typed in is a 3 or an 4 then increment noCount and print out "NO WAS RECORDED" If the input is invalid just print the message "INVALID" and do nothing else. ASSUME the availability of a variable, stdin, that references a Scanner object associated with standard input.
Computers and Technology
1 answer:
sergejj [24]2 years ago
6 0

// This command takes input from the user.

Scanner input = new Scanner(System.in);

int response= input.nextInt();

// Making the variables required

int noCount =0 ;

int yesCount =0;

// Checking the response if it is 1 or 2 and reporting accordingly

if(response == 1 || response ==2){

 yesCount+=1;

 System.out.println("YES WAS RECORDED");

}

// Checking if the input is 3 or 4 then printing the required lines

else if (response == 3 || response ==4){

noCount+=1;

 System.out.println("NO WAS RECORDED");

}

// if the input is not valid than printing INVALID

else{

System.out.println("INVALID");

}

 

 

 

You might be interested in
Nate wants to copy the style of his contact address to the normal template. Complete the paragraph to describe how he can access
blondinia [14]

Answer:

1) Nate open his template first and clicks the tab on the ribbon

2) Then, he clicks the dialog box that appears

3) He chooses Templates from the menu

4) Clicks Go to clicks the Organizer button

5) Then he clicks copy

6) Next he clicks on the left side to the backstage view

7) Finally, he selects the document that includes the style he wants to transfer to the normal template

Explanation:

I hope this helps

5 0
2 years ago
1)When the liquid is spun rapidly, the denser particles are forced to the bottom and the lighter particles stay at the top. This
Delvig [45]

Answer:

Centrifugation.

Explanation:

When the liquid is spun rapidly, the denser particles are forced to the bottom and the lighter particles stay at the top. This principle is used in centrifugation.

Centrifugation can be defined as the process of separating particles from a liquid solution according to density, shape, size, viscosity through the use of a centrifugal force. In order to separate these particles, the particles are poured into a liquid and placed in a centrifuge tube. A centrifuge is an electronic device used for the separation of particles in liquid through the application of centrifugal force. Once the centrifuge tube is mounted on the rotor of the centrifuge, it is spun rapidly at a specific speed thereby separating the solution; denser particles are forced to the bottom (by moving outward in the radial direction) and the lighter particles stay at the top as a result of their low density.

6 0
2 years ago
Joe, Kate and Jody are members of the same family. Kate is 5 years older than Joe. Jody is 6 years older than Kate . The sum of
mezya [45]

Answer:

5, 10 and 16

Explanation:

The sum of their ages is √961 = 31

If Joe is x years old, the equation that follows is:

x + (x+5) + (x+5+6) = 31

This simplifies to

3x = 31 - 11 - 5 = 15

so x=5

From that you can find

Joe = x = 5

Kate = x+5 = 10

Jody = x+5+6 = 16

5 0
2 years ago
Read 2 more answers
Drag each tile to the correct box.
garri49 [273]
I think select the video insert select the movie option under illustrations resize the video player then select the insert tab i’m not 100 percent sure tho
8 0
2 years ago
Read 2 more answers
Suppose that the data mining task is to cluster points (with (x, y) representing location) into three clusters, where the points
solong [7]

Answer:

Explanation:

K- is the working procedure:

It takes n no. of predefined cluster as input and data points.

It also randomly initiate n centers of the clusters.

In this case the initial centers are given.

Steps you can follow

Step 1. Find distance of each data points from each centers.

Step 2. Assign each data point to the cluster with whose center is nearest to this data point.

Step 3. After assigning all data points calculate center of the cluster by taking mean of data points in cluster.

repeat above steps until the center in previous iteration and next iteration become same.

A1(4,8), A2(2, 4), A3(1, 7), B1(5, 4), B2(5,7), B3(6, 6), C1(3, 7), C2(7,8)

Centers are X1=A1, X2=B1, X3=C1

A1 will be assigned to cluster1, B1 will be assigned to cluster2 ,C1 will be assigned to cluster3.

Go through the attachment for the solution.

5 0
2 years ago
Other questions:
  • A _______ is a shortcut to a web page saved in a list in the internet explorer desktop application.
    14·1 answer
  • To read encrypted data, the recipient must decipher it into a readable form. what is the term for this process? re-securing decr
    5·1 answer
  • Write the definition of a function printLarger, which has two int parameters and returns nothing. The function prints the larger
    15·1 answer
  • FTP requires confirmation that a file was successfully transmitted to a client, but it has no built-in mechanism to track this i
    5·1 answer
  • Given an alphabet, print all the alphabets up to and including the given alphabet.
    15·2 answers
  • The effectiveness of a(n) _____ process is essential to ensure the success of a data warehouse. Select one: a. visual basic b. e
    15·2 answers
  • Juan, a network user, sends an email to you, the IT admin of the network, stating that his account is locked because he has lost
    14·1 answer
  • Write a function named file_stats that takes one string parameter (in_file) that is the name of an existing text file. The funct
    7·1 answer
  • A program is divided into 3 blocks that are being compiled on 3 parallel computers. Each block takes an Exponential amount of ti
    6·1 answer
  • Laura is the first person in her SDLC team to detect and predict security vulnerabilities in the software. In which phase is Lau
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!