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
xxTIMURxx [149]
4 years ago
7

Write a program that asks the user for a number in the range of 1 through 7. The program should display the corresponding day of

the week, where 1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday, and 7 = Sunday. The program should display an error message if the user enters a number that is outside the range of 1 through 7.
Computers and Technology
1 answer:
Tasya [4]4 years ago
8 0

Answer:

#include <iostream>

using namespace std;

int main()

{

int day;

cout<<"Enter a number for the day of the week"<<endl;

cin>> day;

switch (day) {

case 1: cout << "Monday"<< endl; break;

case 2: cout << "Tuesday" << endl; break;

case 3: cout << "Wednesday" << endl; break;

case 4: cout << "Thursday" << endl; break;

case 5: cout << "Friday" << endl; break;

case 6: cout << "Saturday" << endl; break;

case 7: cout << "Sunday" << endl; break;

default: cout<<"Error, You entered an invalid day"<<endl;

}

   return 0;

}

Explanation:

The program is written using a switch statement in C++ programming language. we start off by creating a variable day of type integer, which is received using the cin statement. We then use switch statement to test the value using the conditions stated in the question. We use the default statement which acts like an else  statement to handle the an invalid situation

You might be interested in
How do you change between worksheets inside an excel workbook?
pochemuha
The correct answer is A
8 0
3 years ago
Read 2 more answers
Before radio, many minority musicians were severely limited by the prejudice of the era. true o rfalse
Ipatiy [6.2K]

Answer:

true

Explanation:

false

8 0
3 years ago
Read 2 more answers
What is collaboration software?
LenKa [72]
<span>I'm not sure but I do know Collaboration means working together toward a mutual goal. so I hope that helps at least a little </span>
7 0
3 years ago
Read 2 more answers
In December of 2009, hackers broke into computer systems and stole secret defense plans of the United States and South Korea. Th
svetlana [45]

Answer:

Cyberterrorism

Explanation:

Cyberterrorism is unlawful use and exploitation of computers and networks (internet) by an individual or a group.

This is done to carry out illegal activities that can cause serious harm to people, government or causing large scale damage to computer systems.

The motivation behind cyberterrorism is usually to achieve some political or ideological or personal objectives, to cause disruption and coercion in a community, to damage the security systems or other government programs thus causing "terror".

Cyberterrorism is done using internet to cause damage to other computer systems  by means of malicious software in order to create disruption, terror or stealing the sensitive information.

For example the cyber terrorists can steal confidential information of military department by attacking the security systems for some political gain just as the hackers stole secret defense plans of US and South Korea which was an act of cyberterrorism.

7 0
4 years ago
If 2 bits of a byte are in error when the byte is read from ECC memory, can ECC detect the error? Can it fix the error?
Misha Larkins [42]

Answer:

Explanation:

Error-correcting code memory (ECC memory) these kinds of memories can detect and correct errors but only in single bit of the byte, in this case, if there is more than one bit, for example, two bits, the ECC memory can detect the error but cannot fix it, there are some memories without ECC can detect errors but not correct it.

4 0
3 years ago
Other questions:
  • Your friends’ preschool-age daughter Madison has recently learned to spell some simple words. To help encourage this, her parent
    8·1 answer
  • With iteration-control systems, each team member ________. is given an account with a set of permissions is given their own priv
    6·1 answer
  • Select the three early tools that were prototypes of modern farming tools used for harvesting crops.
    14·1 answer
  • In database transaction concurrency, the lost update anomaly is said to occur if a transaction Tj reads a data item, then anothe
    6·1 answer
  • A company has a number of employees. The attributes of EMPLOYEE include Employee ID (identifier), Name, Address, and Birthdate.
    11·1 answer
  • Which one is not considered part of the cinematography team?
    7·2 answers
  • Write the algorithm for finding the perimeter of a rectangle using English like form step by step
    10·1 answer
  • Assume the following:
    10·1 answer
  • What year was html released?
    11·2 answers
  • declaring a member as in the base class provides access to that member in the derived classes but not to anyone else.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!