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
almond37 [142]
3 years ago
9

Assume a machine during its initial testing phase produces 10 widgets a day. After 10 days of testing (starting on day 11), it b

egins to run at full speed, producing 40 widgets a day. After 50 days at full speed (days 11-60), it gradually starts becoming less productive, and produces 1 fewer widget per day, (ie. 39 widgets on day 61, etc.) until on day 100 it no longer produces any widgets.
Required:
Write a program that will read in a day number from the keyboard and will report the total number of widgets produced from the initial testing phase up to and including the day entered. For example, entering 3 would report 30 widgets.
Computers and Technology
1 answer:
lana [24]3 years ago
4 0

Answer:

Written in Python:

n = int(input("Days: "))

total = 0

for i in range(1,n+1):

     if i <= 10:

           total = total + 10

     elif i <= 60:

           total = total + 40

     elif i <= 99:

           total = total + 100 - i

print(str(total)+ " widgets")

Explanation:

This line prompts user for number of days

n = int(input("Days: "))

This line initializes total widgets to 0

total = 0

The following iteration calculates the widgets based on the given instruction

<em>for i in range(1,n+1):</em>

<em>      if i <= 10: </em><em>-> When there are less than or equal to 10</em>

<em>            total = total + 10</em>

<em>      elif i <= 60: </em><em>-> When there are less than or equal to 10</em>

<em>            total = total + 40</em>

<em>      elif i <= 99: </em><em>-> When there are less than 100 days</em>

<em>            total = total + 100 - i</em>

This line prints the output

<em>print(str(total)+ " widgets")</em>

You might be interested in
Write a program having a concrete subclass that inherits three abstract methods from a superclass. Provide the following three i
hammer [34]

Answer:

C++

Explanation:

using namespace std;

class AbstractClass {

public:  

   virtual bool checkUpperCase(string inputString);

   virtual string lowerToUppercase(string inputString);

   virtual void stringToInt(string inputString);

};

class ConcreteClass: public AbstractClass {

public:

   bool checkUpperCase(string inputString) {

       bool isUpper = false;

       for (int i=0; i < strlen(inputString);  i++) {

           if (isupper(inputString[i])) {

               isUpper = true;

               break;

           }

       return isUpper;

      }

   string lowerToUppercase(string inputString) {

       for (int i=0; i < strlen(inputString);  i++) {

           putchar(toupper(inputString[i]));

       }

       return inputString;

   }

   void stringToInt(string inputString) {

       int convertedInteger = stoi(inputString);

       convertedInteger+=10;

       cout<<convertedInteger<<endl;

   }

};

int main() {

   ConcreteClass cc;

   return 0;

}

3 0
3 years ago
I NEED HELP RIGHT NOW !!!!!!!!!!!!!!!1
Alex17521 [72]
Are tools used to assist in conveying information during a presentation. When a speaker is verbally addressing an audience it is often necessary to use supplementary equipment and media to clarify the point. [ If the audience is large or the speaker is soft-spoken, a public address system may be employed

hope this help       plz mark brainliest
5 0
3 years ago
Read 2 more answers
How is your day going who wants to hit <br><br><br><br> Jk, go find someone else.
kap26 [50]
Lol my days been hectic wby. I’ve been studying
3 0
3 years ago
Develop an sec (single error correction) code for a 16-bit data word. generate the code for the data word 0101000000111001. show
Kipish [7]

Answer:

code = 010100000001101000101

Explanation:

Steps:

The inequality yields 2^{k} - 1 > = M+K, where M = 16. Therefore,

The second step will be to arrange the data bits and check the bits. This will be as follows:

Bit position              number              Check bits            Data Bits

21                                   10101

20                                  10100

The bits are checked up to bit position 1

Thus, the code is 010100000001101000101

3 0
4 years ago
Read 2 more answers
1) What is Database? List its Uses.<br>​
Serggg [28]

Answer:

a database stores a large sum of data

Explanation:

its used to keep track of things like student names bank accounts and other things

7 0
3 years ago
Other questions:
  • Dave has to create animations for a game. Which tool can Dave use?
    9·2 answers
  • Assume you have a sorting algorithm that you can use as a black box. Use the sorting algorithm to sort the input list. Now write
    10·1 answer
  • เเปลภาษานิราศภูเขาทอง
    10·1 answer
  • Like Tess, Brina has a fascinating job! She works as a software engineer with Instagram. She says that Computer Science is a way
    10·2 answers
  • A machine called a centrifuge is used in _____.
    8·1 answer
  • You are planning to buy a new server that will act as the server portion of a client/server application. A colleague of yours ma
    9·1 answer
  • At the ________ level of an organization, functional managers focus on monitoring and controlling operational-level activities a
    14·2 answers
  • Use the drop-down menus to match the description to the correct audio-editing technique or term. deleting unwanted sounds increa
    14·2 answers
  • Convert the following decimal number into octal number-147​
    11·1 answer
  • Which case would benefit from Explainable Artificial Intelligence (AI) principles?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!