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
Kobotan [32]
3 years ago
6

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.
Computers and Technology
1 answer:
qaws [65]3 years ago
8 0

Answer:

Explanation:

RESPONSE = stdin.nextInt();

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

YESCOUNT++;

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

}

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

NOCOUNT++;

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

}

else

System.out.println("INVALID");

You might be interested in
What is WEB 1.0 to WEB3.0
Allushta [10]
It's a marketing term. Web1.0 is the www as a static resource of pages and documents. Web2.0 adds interactivity, scripting and databases. Web3.0 suggests semantic integration of different sources, like single sign-on. Not many 3.0 elements exist today.
3 0
3 years ago
____ technology essentially takes the data to be transmitted and rather than transmitting it in a fixed bandwidth spreads it ove
aleksley [76]

Answer: Spread spectrum

Explanation:

In spread spectrum the data to be transmitted is spread over a wider bandwidth rather than fixed bandwidth.

4 0
3 years ago
Write a program that takes an integer n as a parameter and sums all of the multiples of 2 or 5 from 1 to n. For example, if n =
Alex

Answer:

// here is code in c++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main() {

// variable

int num;

int tot_sum=0;

cout<<"enter a number: ";

// read the value of n

cin>>num;

// check the multiple of 2 or 5 from 1 to n

for(int x=1;x<=num;x++)

{

// if multiple of 2 or 5 then add them

   if(x%2==0 ||x%5==0)

   {

       tot_sum=tot_sum+x;

   }

}

// print the sum

cout<<"sum of multiple of 2 or 5 is:"<<tot_sum<<endl;

return 0;

}

Explanation:

Read the number "n" from user.Check every number from 1 to n, if it is a multiple of 2 or 5 then add them to "tot_sum".When the for loop end, "tot_sum" will have sum of all the number which are either multiple of 2 or 5.Print the sum.

Output:

enter a number:11

sum of multiple of 2 or 5 is:35

4 0
3 years ago
Which of these is not a combination of a keyboard and percussion musical instrument?
Sergio [31]

Answer:

The Harmonium is not a combination of a key board and percussion musical instrument.

Explanation:

The Harmonium is not a combination of a key board and percussion musical instrument.

A harmonium, also called a "melodeon", "reed organ" or "pump organ", is a keyboard instrument that is a lot like an organ. It makes sound by blowing air through reeds, which are tuned to different pitches to make musical notes.

3 0
3 years ago
Mary wants to rearrange the slides of her presentation. Which option should she use?
Gnesinka [82]

The answer is "Slide Sorter view". Some of the online courses say that all words must be spelled correctly and in the correct order, so if you don't have exactly what they want they will mark it as "wrong".

6 0
3 years ago
Other questions:
  • What does bam file stand for computer terms?
    9·1 answer
  • You are provisioning a server with eight-core 3 GHz CMP that can execute a workload with an overall CPI of 2.0 (assuming that L2
    5·1 answer
  • I'm the state of Florida, your first conviction for DUI can result in your vehicle being impounded for
    5·1 answer
  • Jared does not update his computer’s system software. What threat does his computer face?
    9·1 answer
  • Which is an example of Raw Input?
    11·1 answer
  • To switch from one open document to another, press _____.
    6·1 answer
  • Jane is creating a slide that will have a large heading and number of bullet points below it. What slide format should she use?
    12·1 answer
  • What is a multipurpose network device?
    10·1 answer
  • WAFL (write-anywhere file layout) Select one: a. is a distributed file system b. is a file system dedicated to single user opera
    6·1 answer
  • Someone put malware on your computer that records all of your keystrokes. what aspect of security was primarily attacked? choose
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!