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
erastova [34]
2 years ago
12

(2) Design pseudocode for a program that accepts numbers from the user until the special number 555 is entered (you should use a

n indefinite loop for this.) After the user enters the special value, your program should output the number of numbers entered AND the sum of those numbers.
Computers and Technology
1 answer:
elena-s [515]2 years ago
7 0

Answer:

Pseudocode is explained below

Explanation:

# Create a variable to count the numbers.

numberOfNumbers = 0

# Create a variable to store the sum of numbers.

sumOfNumbers = 0

# Create a constant to store the special numbers.

constant specialNumber = 222

# Start the loop.

while True:

{

   # Prompt the user to enter a number.

   num = input("Enter a number: ")

   # Break the loop if the number is

   # equal to the special number.

   if num == 222:

   {    

       break

   }

   

   # Otherwise, add the number in the current

   # sum and increment the number of values.

   else:

   {

       sumOfNumbers = sumOfNumbers + num

       numberOfNumbers = numberOfNumbers + 1

   }

}

# Display the values.

print("The number of numbers = ", numberOfNumbers)

print("The sum of numbers = ", sumOfNumbers)

You might be interested in
Compare the current in two lightbulbs wired in a series circuit
julia-pushkina [17]
<span>The current flow in two light bulbs wired in a series circuit is identica</span>
7 0
3 years ago
What does the following statement do? vector v(10, 2);
Alecsey [184]

Answer:

D) It creates a vector object with a starting size of 10 and all elements are initialized with the value 2.

Explanation:

When you write the statement vector<int> v(10,2); This statement declares a vector or dynamic array of size 10 that is the first parameter and the second parameter is the value with which all the elements in the vector are to be initialized.So in this vector all the 10 values will be initialized with the value 2.It is one of the way of initializing the vector.

3 0
2 years ago
A customer in a store is purchasing five items. Design a program that asks for the price of each item, and then displays the sub
kykrilka [37]
What language are you programming in? 

<span>If you are programming in C or C++, you could do something like this: </span>

<span>#include <iostream> </span>
<span>using namespace std; </span>

<span>int main(void) </span>
<span>{ </span>
<span>//declarations </span>
<span>double item1 = 0; </span>
<span>double item2 = 0; </span>
<span>double item3 = 0; </span>
<span>double item4 = 0; </span>
<span>double item5 = 0; </span>
<span>double subtotal = 0; </span>
<span>double total = 0; </span>
<span>double tax = 0; </span>

<span>//Enter Items </span>
<span>cout << "Please enter the price of item 1"; </span>
<span>cin >> item1; </span>

<span>cout << "Please enter the price of item 2"; </span>
<span>cin >> item2; </span>

<span>cout << "Please enter the price of item 3"; </span>
<span>cin >> item3; </span>

<span>cout << "Please enter the price of item 4"; </span>
<span>cin >> item4; </span>


<span>cout << "Please enter the price of item 5"; </span>
<span>cin >> item5; </span>


<span>//Compute subtotal </span>
<span>subtotal = (item1 + item2 + item3 + item4 + item5 + item6); </span>

<span>//Compute amount of tax </span>

<span>tax = subtotal * (.06); </span>

<span>//Compute total </span>

<span>total = subtotal + tax; </span>

<span>//Display subtotal, total, and amount of tax </span>

<span>cout < " The subtotal of the sale is: " << subtotal << endl; </span>
<span>cout < " The amount of sales tax is: " << tax << endl; </span>
<span>cout < " The total of the sale is: " << total << endl; </span>

<span>return 0; </span>

<span>}//end of function main </span>


<span>I know this is a very very basic C++ program but I hope it helps and good luck on your project!</span>
5 0
2 years ago
What when can you expect technology to be effective?
loris [4]

Answer:

we dont have to expect , the technology are effective , as each day the technology are being advance and developed day by day. each day the technology are being more and more effective. they are effective now and they will be effective in future too

3 0
2 years ago
You have used loops for repetitive processes.
zzz [600]

Answer:

for

Explanation:

because:

  • IF = conditional
  • WHILE = conditional
  • DO = isn't a loop function
5 0
3 years ago
Other questions:
  • Which of the following is not a typical step in the ethical hacking process? A. Planning B. Discovery C. Attack D. Recovery
    5·1 answer
  • Provide an example of a time in your personal or work life when you used the household measuring system and measured out an exac
    6·1 answer
  • What will allow you to purchase software without receiving full rights to the program?
    14·1 answer
  • This toolbar can be used to change the way the text in your presentation looks. Drawing
    5·2 answers
  • python A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun
    15·2 answers
  • When you write Click a picture in a word processing program which actions can you choose to perform on the image
    6·1 answer
  • ---------------is a systematic review of a person’swork and achievements over a recent period, usually leading toplans for the f
    11·1 answer
  • What is a trusted computing base (TCB)? Hosts on your network that support secure transmissions The operating system kernel and
    9·1 answer
  • Define management styles
    14·2 answers
  • True or False: Once you rename a field, the new field name must be used in the rest of the search string.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!