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
vlabodo [156]
3 years ago
4

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

Answer:

Explanation:

The result structure that we are to use to arrange this program needs to have the ability to differentiate paths depending on way of 8 different inputs that is given (one for every day of the week and another one incase the input is outside the range it's supposed to be in). A group of nested “if” statements should work but would be horribly complicated in looking. A much more innovative approach is to use an if - elif - else structure:

user_input = input('Enter a number: ')

if user_input == '1':

    print(user_input, '= Monday')

elif user_input == '2':

    print(user_input, '= Tuesday')

elif user_input == '3':

    print(user_input, '= Wednesday')

elif user_input == '4':

    print(user_input, '= Thursday')

elif user_input==  '5':

    print(user_input, '= Friday')

elif user_input==  '6':

    print(user_input, '=Saturday')

elif user_input == '7':

    print(user_input, '=Sunday')

else:

    print('Error: That number doesn\'t correspond to a day of the week.')

You might be interested in
In the URL, what is the subdomain and what is the domain name?
timurjin [86]

<u>Answer</u>:

<u>EXAMPLES:</u>

Primary domain name could be “bestwebdesigner.com,”

subdomain to that domain called “blog.bestwebdesigner.com.”

<u>Explanation</u>:

Essentially, a subdomain is a separate part of your website that operates under the same primary domain name.

5 0
4 years ago
ANSWERS FOR PLATO!!!
Anastaziya [24]

The thing which the second element in a pair of HTML tags contain is "/" and is known as the Closing Tag.

<h3>What is an HTML Tag?</h3>

This refers to the keywords that are used in the building block of a website to indicate how a web browser would interpret and display the content.

Hence, we can see that in HTML tags, there are always the Opening and Closing Tags that are used to enclose lines of code and when paired together are known as container tags.

Read more about HTML elements here:

brainly.com/question/9069928

#SPJ1

6 0
2 years ago
Which input value causes the loop body to execute a 2nd time, thus outputting "In loop" again? { String s = "Go"; while ((!s.equ
Ksenya-84 [330]

Answer:

a) "Quit"  

c) "Q only

Explanation:

Given

<em>String s = "Go"; </em>

<em>while ((!s.equals("q"))&& (!s.equals("")))  {</em>

<em>System.out.println("In loop"); </em>

<em>s = scnr.next();</em>

<em>}</em>

<em />

Required

What input causes another execution

Analyzing the while condition

<em>while ((!s.equals("q"))&& (!s.equals("")))  </em>

<em />

This can be split into:

<em>!s.equals("q")) && (!s.equals(""))</em>

<em />

Meaning

When s is not equal to "q" and when s is not an empty string

<em />

In other words,

the loop will be executed when user input is not "q" and user input is not empty.

So, from the list of given options: The loop both will be executed when:

a) Input is "Quit"

c) Input is Q only

<em>Input of q will terminate the loop, hence b and d are incorrect</em>

<em />

6 0
3 years ago
What are they
kifflom [539]
1) Input devices are any devices that input information to the computer - Examples include your keyboard, mouse, microphone, ect.

2) Output devices are any devices that output information from the computer. - Examples include your monitor, printer, headset/speakers, ect.

3) Processing devices are devices that take the information and process it. The most obvious example of this is the Central Processing Unit (CPU) on your computer.
6 0
4 years ago
Read 2 more answers
what occurs when two adjacent conductors make electrical contact and by-pass a portion of the circuit?
Naily [24]
Its  a short circuit.
5 0
3 years ago
Other questions:
  • Write a for loop that displays the following set of numbers: 0,10,20,30,40,50....1000
    10·1 answer
  • By default, the Windows desktop displays
    6·1 answer
  • In the context of computer crimes, those who attempt to destroy the infrastructure components of governments and financial insti
    7·1 answer
  • To save a file so that it can be opened on most computers, select the ____ option.
    10·2 answers
  • To remove an embedded chart, you should _____ it and press the DELETE key. (Points : 2) move drag hide click
    15·1 answer
  • In a digit 13 ISBN number, can you think of errors that the check digit system cannot identify and give an example to explain wh
    5·1 answer
  • The D:\ drive in your computer has been formatted with NTFS. The Mary user account has been assigned the following permissions:
    10·1 answer
  • Which of the following is not a data visualization technique?
    6·1 answer
  • I'm asking more questions for help with schoolwork, thank you for the help, giving Brainliest.
    6·1 answer
  • .WAP to enter monthly sale of Salesman and give him commission i.E. If the monthly sale is more than 500000 then commision will
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!