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
stellarik [79]
3 years ago
11

) Perform error checking for the data point entries. If any of the following errors occurs, output the appropriate error message

and prompt again for a valid data point. If entry has no comma Output: Error: No comma in string. (1 pt) If entry has more than one comma Output: Error: Too many commas in input. (1 pt) If entry after the comma is not an integer Output: Error: Comma not followed by an integer. (2 pts)
Computers and Technology
1 answer:
emmainna [20.7K]3 years ago
4 0

Answer:

In Python:

entry = input("Sentence: ")

while True:

   if entry.count(",") == 0:

       print("Error: No comma in string")

       entry = input("Sentence: ")

   elif entry.count(",") > 1:

       print("Error: Too many comma in input")

       entry = input("Sentence: ")

   else:

       ind = entry.index(',')+1

       if entry[ind].isnumeric() == False:

           print("Comma not followed by an integer")

           entry = input("Sentence: ")

       else:

           break

print("Valid Input")

Explanation:

This prompts the user for a sentence

entry = input("Sentence: ")

The following loop is repeated until the user enters a valid entry

while True:

This is executed if the number of commas is 0

<em>    if entry.count(",") == 0:</em>

<em>        print("Error: No comma in string")</em>

<em>        entry = input("Sentence: ")</em>

This is executed if the number of commas is more than 1

<em>    elif entry.count(",") > 1:</em>

<em>        print("Error: Too many comma in input")</em>

<em>        entry = input("Sentence: ")</em>

This is executed if the number of commas is 1

   else:

This calculates the next index after the comma

       ind = entry.index(',')+1

This checks if the character after the comma is a number

       if entry[ind].isnumeric() == False:

If it is not a number, the print statement is executed

<em>            print("Comma not followed by an integer")</em>

<em>            entry = input("Sentence: ")</em>

If otherwise, the loop is exited

<em>        else:</em>

<em>            break</em>

This prints valid input, when the user enters a valid string

print("Valid Input")

Note that: entry = input("Sentence: ") <em>is used to get input</em>

You might be interested in
A light or optical microscope most commonly used is called a(n) _____. bright-field microscope dark-field microscope electron mi
puteri [66]
I think a bright field is most commonly used
5 0
4 years ago
Read 2 more answers
What is the primary reason that companies use third party tracking cookies?
morpeh [17]

Answer:

The most common use of third-party cookies is to track users who click on advertisements and associate them with the referring domain.

Explanation:

For example, when you click on an ad on a website, a third-party cookie is used to associate your traffic with the site where the ad appeared.

5 0
3 years ago
Though most of the content on this social network is uploaded by amateurs, many companies offer streaming video content related
Nikitich [7]
The answer to this is the youtube channel. The youtube channel is very common and very popular to everyone. Each and every one of us could not deny that we would watch a video from youtube maybe at least once a day. Youtube is very effective, it is also very efficient and easy to use.
6 0
3 years ago
Alex, a web designer, is assigned the task of creating a mobile device-friendly website for a leading fashion outlet called AllS
Katyanochek1 [597]

Answer: Pulldown menus

Explanation:

Pulldown menus refer to the graphical control element, that is identical to a list box, which enables user to be bake to select one value from a list.

They're regarded as the menu of options that will appear when an item is selected with a mouse. In this case, the item that the user selected will show at the top of the display screen, while the menu appears will show below it.

Therefore, Alex should use the pulldown menus to hide the long list of hypertext links so that it appears only in response to a tap of a major heading in the navigation list.

6 0
3 years ago
Danelle wants to use a stylus on her laptop but does not have a touch screen. She needs the stylus to help her create designs fo
yarga [219]

Answer:

Correct option is

A. She can add a digitizer over the screen on her laptop

Explanation:

A digitizer is a hardware that receives analogue signal and converts is to digital signal.To use stylus on a normal laptop when can attach a digitizer to the laptop.These digitizer comes in form of Tablet (Graphics Tablet)

Graphics tablet is an external tablet like slate with a dedicated stylus for hand drawn designing and arts. Use of stylus gives more command over design features.It can read any kind of hand written data and transfer to PC.

5 0
3 years ago
Other questions:
  • How many bits are required to address a 1mx8 main memory if main memory is byte addressable?
    6·1 answer
  • Which is a good guideline to follow for adding animation to a presentation?. A. Use a different animation for each slide.. B. Us
    8·2 answers
  • By default, EC2 instances pull SQS messages from an SQS queue on a FIFO basis.
    6·1 answer
  • Seven Features of computer aids design software
    6·1 answer
  • See the answerWrite a setInterval() function that increases the count by 1 and displays the new count in counterElement every 30
    11·1 answer
  • A program reads three integer values. The three values are interpreted as representing the lengths of the sides of a triangle. T
    7·1 answer
  • A consumer wants to add a hard drive to their computer to store video from their camera. Which of the following would represent
    9·1 answer
  • Write a print statement that displays a random integer between 5 and 5000. Assume the random library is imported.
    12·1 answer
  • 2.3 Code Practice: Question 1
    5·1 answer
  • While some audio recording programs are expensive, there are more user friendly,
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!