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
nlexa [21]
3 years ago
10

Assuming that the valid cost should be between 100 and 200, does the following code snippet test this condition correctly?

Computers and Technology
1 answer:
schepotkina [342]3 years ago
8 0

Answer:

  • No, Only the value between 100 and 200 can not test the code correctly.
  • This code snippet ensures that the cost value is between 100 and 200.

Explanation:

  • The above code has three condition test- if, else-if and else.
  • The first condition is true for the value which is a minimum of 100.
  • The else if condition is true for the value which is maximum from 200.
  • Then the else condition is used when the if and else if condition is false.
  • when the user gives the value between 100 and 200 then it will test that the value lies between 100 or 200.
  • To test the whole scenario there must be one value is less than 100 and greater than 200.
You might be interested in
Write a script named numberlines.py. This script creates a program listing from a source program. This script should: Prompt the
ddd [48]

Answer:

See explaination for program code.

Explanation:

inputFileName = input("Input filename: ") outputFileName = input("Output filename: ") inputFile = open(inputFileName, "r") outputFile = open(outputFileName, "w") count = 1 for line in inputFile: newLine = str(count).rjust(4, " ") + "> " + line outputFile.write(newLine) print(newLine) count += 1

4 0
3 years ago
Write a program that will take an integer and add up each of the number’s digits, count the number of digits in the number, and
Inga [223]
For count digits, you could just convert it to a String and check the length
Sum digits, convert to string then seperate each character with charAt then convert it to numbers in the return statement.
Average digits you can convert it to a String and then convert them back after taking them apart.
5 0
3 years ago
Read 2 more answers
The right of workers to seek safety and health on the job without fear of punishment is spelled out in:
mr Goodwill [35]
The answer to the question is C.
3 0
3 years ago
Which of the following is a domestic business activity?
harkovskaia [24]
What are the options?

7 0
3 years ago
Read 2 more answers
A presentation software that is used to organize and present pertinent information using graphics, word processing, outlining, d
lesantik [10]

Answer:

C

Explanation:

Well, in your inquiry it says

"A presentation software that is used to organize and present pertinent information using graphics, word processing, outlining, drawing, and presentation management tools"

We know it isn't Microsoft Word, because Microsoft Word doesn't have a presentation feature. We know it isn't Excel because Excel is only meant for spreadsheet and analytics data.

However, on PowerPoint all these points make sense, PowerPoint is a tool that Microsoft created for the capabilities such as to present information, you can also put information inside of graphics as well, you can also draw, and outline too.

5 0
3 years ago
Other questions:
  • 4. The same data source can be used multiple times in creating mail-merge documents.
    7·1 answer
  • How can I sent a message?
    13·1 answer
  • What is the voltage drop across R4 in the diagram shown above?
    13·1 answer
  • What does a data bar in a cell represents​
    12·2 answers
  • PMI is a: computer program used to help managers write mission statements. rule of thumb used to determine how many employees sh
    15·1 answer
  • EX 3.8 Write code to declare and instantiate an object of the Random class (call the object reference variable rand). Then write
    6·1 answer
  • Next, Leah wants to add a content slide that allows her to insert a table.
    8·2 answers
  • PrimeFactorization.java: Write a program that begins by reading in a series of positive integers on a single line of input and t
    12·1 answer
  • Hi All,
    12·2 answers
  • 4. Contoso, Ltd. has a vigorous Office 365 and Azure cloud-service presence.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!