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
Rainbow [258]
3 years ago
14

Write a python application that allows a user to enter any number of student test scores until the user enters 999. If the score

entered is less than 0 or more than 100, display an appropriate message and do not use the score. After all the scores have been entered, display the number of scores entered and the arithmetic average.
Computers and Technology
1 answer:
Kryger [21]3 years ago
7 0

Answer:

This program is as follows

<em>total = 0; count = 0</em>

<em>testscore = int(input("Score: "))</em>

<em>while testscore != 999:</em>

<em>    if testscore < 0 or testscore > 100:</em>

<em>        print("Out of range")</em>

<em>    else:</em>

<em>        total+=testscore</em>

<em>        count+=1</em>

<em>    testscore= int(input("Score: "))</em>

<em>print(count,"scores entered")</em>

<em>print("Arithmetic Average:",total/count)</em>

Explanation:

This initializes total and count to 0

total = 0; count = 0

This gets input for score

testscore = int(input("Score: "))

The following iteration stop when 999 is entered

while testscore != 999:

This prints out of range for scores outside 0 - 100

   if testscore < 0 or testscore > 100:

<em>        print("Out of range")</em>

Otherwise

   else:

The total score is calculated

       total+=testscore

The number of score is calculated

       count+=1

Get another input

   testscore = int(input("Score: "))

The number of score is printed

print(count,"scores entered")

The average of score is printed

print("Arithmetic Average:",total/count)

You might be interested in
What are somd negetive aspects and some positive aspects of having robots as a part of workplace?
aksik [14]

Answer and Explanation:

Some of the negative aspects of robots at work place:

  • Lesser flexibility
  • Higher maintenance and installation cost
  • Future insecurity and risk if the system malfunctions
  • A decline in the opportunities for humans
  • Unemployment as a result of automation and robot regulated work place.

Some of the positive aspects of robots at work place:

  • Higher accuracy
  • Higher speeds
  • More work in less time
  • Productivity and hence efficiency will increase
  • Cost of some operations is reduced.
  • Ease of employing in dangerous and hazardous fields by using specific robots for each task
5 0
2 years ago
Suppose that, on average, 4 percent of all cd drives received by a computer company are defective. the company has adopted the f
kicyunya [14]

The fraction of shipments that will be accepted is 0.1299.

<h3>How to calculate the probability?</h3>

Probability of a defective DVD = 0.04

Using Binomial distribution,

Fraction of shipments accepted = Probability of zero defects in sample of 50 = P(X = 0)

= 50C0 * 0.040 * (1 - 0.04)⁵⁰

= 0.96⁵⁰

= 0.1299

Fraction of shipments accepted = Probability of zero or one defects in sample of 50 = P(X = 0) + P(X = 1)

= 50C0 * 0.040 * (1 - 0.04)50-0 + 50C1 * 0.041 * (1 - 0.04)50-1

= 0.9650 + 50 * 0.04 * 0.9649

= 0.4005

Learn more about probability on:

brainly.com/question/24756209

#SPJ1

6 0
2 years ago
Create a TeeShirt class for Toby’s Tee Shirt Company. Fields include:
Ainat [17]

Answer:

Here is the TeeShirt class:

public class TeeShirt{  //class name

   private int orderNumber;  // private member variable of type int of class TeeShirt to store the order number

   private String size;  // to store the size of tshirt

   private String color;  //  to store the color of shirt

   private double price;  // to store the price of shirt

   public void setOrderNumber(int num){  //mutator method to set the order number

       orderNumber = num;     }    

   public void setColor(String color){  //mutator method to set the color

       this.color = color;        }      

       

     public void setSize(String sz){  //mutator method to set the shirt size

   size = sz;  

   if(size.equals("XXXL") || size.equals("XXL")){  //if shirt size is XXL or XXXL

       price = 22.99;  // set the price to 22.99 if shirt size is XXL or XXXL

   }else{  //for all other sizes of shirt

       price = 19.99;     }  }  //sets the price to 19.99 for other sizes

   public int getOrderNumber(){  //accessor method to get the order number stored in orderNumber field

       return orderNumber;     }  //returns the current orderNumber

   public String getSize(){  //accessor method to get the size stored in size field

       return size;     }  //returns the current size

   public String getColor(){  //accessor method to get the color stored in color field

       return color;     }  //returns the current color

   public double getPrice(){  //accessor method to get the price stored in price field

       return price;      }  } //returns the current price

Explanation:

Here is the sub class CustomTee:

public class CustomTee extends TeeShirt {  //class CustomTee that inherits from class TeeShirt

private String slogan;   //private member variable of type String of class CustomTee to store slogan

public void setSlogan(String slgn) {  //mutator method to set the slogan

slogan = slgn; }

public String getSlogan() {  //accessor method to get the slogan stored in slogan field

return slogan;}  } //returns the current slogan

Here is DemoTees.java

import java.util.*;

public class DemoTees{  //class name

public static void main(String[] args)  {  //start of main method

TeeShirt tee1 = new TeeShirt();  //creates object of class TeeShirt named tee1

TeeShirt tee2 = new TeeShirt(); //creates object of class TeeShirt named tee2

CustomTee tee3 = new CustomTee(); //creates object of class CustomTee named tee3

CustomTee tee4 = new CustomTee();  //creates object of class CustomTee named tee4

tee1.setOrderNumber(100);  //calls setOrderNumber method of class TeeShirt using object tee1 to set orderNumber to 100

tee1.setSize("XXL");  //calls setSize method of class TeeShirt using object tee1 to set size to XXL

tee1.setColor("blue");  //calls setColor method of class TeeShirt using object tee1 to set color to blue

tee2.setOrderNumber(101);  //calls setOrderNumber method of class TeeShirt using object tee2 to set orderNumber to 101

tee2.setSize("S");  //calls setSize method of class TeeShirt using object tee2 to set size to S

tee2.setColor("gray");  //calls setColor method of class TeeShirt using object tee2 to set color to gray

tee3.setOrderNumber(102);   //calls setOrderNumber method of class TeeShirt using object tee3 of class CustomTee to set orderNumber to 102

tee3.setSize("L");  //calls setSize method of class TeeShirt using object tee3 to set size to L

tee3.setColor("red");  //calls setColor method of class TeeShirt using object tee3 to set color to red

tee3.setSlogan("Born to have fun");  //calls setSlogan method of class CustomTee using tee3 object to set the slogan to Born to have fun

tee4.setOrderNumber(104);  //calls setOrderNumber method of class TeeShirt using object tee4 of class CustomTee to set orderNumber to 104

tee4.setSize("XXXL");  //calls setSize method to set size to XXXL

tee4.setColor("black");  //calls setColor method to set color to black

tee4.setSlogan("Wilson for Mayor");  //calls setSlogan method to set the slogan to Wilson for Mayor

display(tee1);  //calls this method passing object tee1

display(tee2);  //calls this method passing object tee2

displayCustomData(tee3);  //calls this method passing object tee3

displayCustomData(tee4);  }   //calls this method passing object tee4

public static void display(TeeShirt tee) {  //method display that takes object of TeeShirt as parameter

System.out.println("Order #" + tee.getOrderNumber());  //displays the value of orderNumber by calling getOrderNumber method using object tee

System.out.println(" Description: " + tee.getSize() +  " " + tee.getColor());  //displays the values of size and color by calling methods getSize and getColor using object tee

System.out.println(" Price: $" + tee.getPrice()); }  //displays the value of price by calling getPrice method using object tee

public static void displayCustomData(CustomTee tee) {  //method displayCustomData that takes object of CustomTee as parameter

display(tee);  //displays the orderNumber size color and price by calling display method and passing object tee to it

System.out.println(" Slogan: " + tee.getSlogan());  } } //displays the value of slogan by calling getSlogan method using object tee

5 0
2 years ago
Free poi nts here you go
tatuchka [14]

Explanation:

<em>Thank</em><em> </em><em>you</em><em> </em>

<em>Bye</em><em> </em><em>and</em><em> </em><em>have</em><em> </em><em>a</em><em> </em><em>great</em><em> </em><em>day</em><em> </em>

4 0
2 years ago
Describe two measures that a school could take to ensure the security of the school network.
Zolol [24]

Answer:

Having a proper firewall that could prevent cyber attacks against black hat hackers, And having good cyber team that has had extensive training and know hows the network operates to ensure smooth sailing for the workers and students. (extra) Ensuring your staff understands the cyber war and knows not to click on malicious links that could allow a cyber crminal in to the network.

Explanation:

BlackHat- Individual that uses his knowlage of computers for malicious use.

Firewall- Enitial intrance into a computer it is a piece of software that have expressions to ensure you are only getting traffic that you have specified on the system and not allowing all traffic on all ports

5 0
3 years ago
Other questions:
  • video-sharing sotes such as youtube and vimeo provide a place to post short videos called clips true or false?
    5·1 answer
  • In a paragraph of no less than 125 words, describe how technology helps business professionals to be more efficient. Include exa
    12·2 answers
  • What is ment by creative middle way solution
    6·1 answer
  • In this mode, your presentation will fill up the entire screen. Auto Default Standard Window
    6·2 answers
  • Assignment Background Video games have become an outlet for artists to express their creative ideas and imaginations and a great
    11·1 answer
  • All of the following are aspects of the search process except
    15·1 answer
  • You are in charge of an event at work. You want to plan and schedule events and resourse. What type of software should you use?
    14·2 answers
  • When a hoverboard's battery dies, does the hoverboard battery life get impacted the next time the battery is full?
    12·1 answer
  • Which of the following will print I'VE GOT THIS on the screen? (5 points)
    14·1 answer
  • Question: Convert data into another form.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!