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
Which is among the earliest formats of audio used in video games? A. MP3 B. wave table synthesis C. pulse code modulation D. MOD
solong [7]

Answer:

MOD

Explanation:

MOD audio file format is primarily used to represent music. It uses the .MOD file extension and has had popularity as background music for independent video games. It would be safe to say that MOD audio file extensions are the most widespread trackers that were used and are still being used in many computer games and demos.

0 0
1 year ago
Read 2 more answers
3.34 LAB: Mad Lib - loops in C++
Ganezh [65]

Answer:

A Program was written to carry out some set activities. below is the code program in C++ in the explanation section

Explanation:

Solution

CODE

#include <iostream>

using namespace std;

int main() {

string name; // variables

int number;

cin >> name >> number; // taking user input

while(number != 0)

{

// printing output

cout << "Eating " << number << " " << name << " a day keeps the doctor away." << endl;

// taking user input again

cin >> name >> number;

}

}

Note: Kindly find an attached copy of the compiled program output to this question.

7 0
1 year ago
Why are smartphones and tablets capable of handling rich content and interactivity?
NikAS [45]

Answer:

Explanation:

With the advance in technology, smartphones, and tablets are built to meet the ever-increasing needs of users.

Smartphones are mobile phones that also have internet connectivity, they can be used to make calls and perform many tasks just like the conventional desktop. Smartphones and tablets are indeed considered computers because they also process inputs in form of commands and they produce outputs.

Smartphones and tablets are capable of handling rich content and interactivity because:

1. Wireless synchronization with other devices: Just like desktops, laptops, they can interact with other devices, and can receive and also send information doesn't matter the distance.

2. They have Internet connectivity.

3. They have strong hardware, good storage capacity.

4. They have inbuilt software and are capable of accepting other software and programs.

5. They are built with an appealing user interface.

6. Just as computers have processors, smartphones and tablets also have processors to ensure their speed at processing informations.

3 0
2 years ago
An author is preparing to send their book to a publisher as an email attachment. The file on their computer is 1000 bytes. When
Yakvenalex [24]

Answer:

See explanation

Explanation:

My explanation to the author is that:

The reduction in size of the attachment doesn't mean that some parts of the book (i.e. the attachment) has been deleted.

I'll also made him understand that the book will retain its original size and contents after downloading by the recipient of the mail.

6 0
2 years ago
Shirley was unsure about what career to go into. Her high school counselor suggested a personal assessment to point out Shirley’
Alex73 [517]
<span>I think that she would be well suited in going into law enforcement or fire fighting. Since she loves to stay active and is cool under pressure, both of those jobs would be very well suited for her personality. Those 2 jobs demand to stay cool into delicate situations. Also, she would be able to come in to help people in need.</span>
4 0
1 year ago
Read 2 more answers
Other questions:
  • Email, instant messaging and most web traffic go across the internet in the clear; that is, anyone who can capture that informat
    15·2 answers
  • Which act was used to penalize Sara? Sara was found to be in possession of a controlled substance for which she had no justifica
    5·1 answer
  • Copy the 10 statements as they appear below into your journal.
    6·2 answers
  • Secure Wi-Fi networks and VPNs use _____ to secure data transferred over a network.
    13·1 answer
  • Which item is essential to know before sketching a navigation menu flowchart? template specifics, such as horizontal or vertical
    12·1 answer
  • Write a class for a Cat that is a subclass of Pet. In addition to a name and owner, a cat will have a breed and will say "meow"
    9·1 answer
  • We have an internal webserver, used only for testing purposes, at IP address 5.6.7.8 on our internal corporate network. The pack
    15·1 answer
  • Using virtualization comes with many advantages, one of them being performance. Which of these is NOT another realistic advantag
    7·1 answer
  • Performing binary search on an unsorted list will always return the correct answer in O(n) time where n is the length of the lis
    9·1 answer
  • Write a MATLAB function named average_of_scores_with_drops The function will have two inputs and two return values. The first in
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!