answer.
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
weeeeeb [17]
2 years ago
14

Write pseudocode for a program which will ask a user to enter two numbers a and b. It then asks what operation is to be performe

d: a*b, a/b, a//b or a%b, performs the appropriate calculation and prints out the result. ​If the user does not enter a valid response, print an error message.
Computers and Technology
1 answer:
sleet_krkn [62]2 years ago
5 0

get int input for a

get int input for b

get string input for operator

if a is not int or b is not int throw exception and print error

if operator is not * / // or % throw exception and print error

if operator is * do multiplication of a and b and make answer c

else if operator is / do division of a and b and make answer c

else if operator is // do floor division of a and b and make answer c

else if operator is % do floor modulo of a and b and make answer c

print c

You might be interested in
To open the format cells dialog box with the alignment sheet active, tap or click the alignment settings ____.
Otrada [13]
<span>To open the format cells dialog box with the alignment sheet active, tap or click the alignment setting button
</span>
3 0
2 years ago
Write an expression that executes the loop body as long as the user enters a non-negative number. Note: If the submitted code ha
Delicious77 [7]

Answer:

Following are the program in C++ language  

#include <iostream> // header file  

using namespace std; // namespace

int main() // main function

{

   int number=0; // variable declaration

   while(number>-1) // iterating the while loop

   {

       

       cout<<"body"<<endl; // dsiplay the statement

       cin>>number; // Read the value by the user

   }

   cout<<endl<<"Done";// dsiplay the statement

   return 0;

}

Output:

body

5

body

45

body

-8

Done

Explanation:

Following are the description of the statement

  • Declared a variable "number" of int type and initialized with 0 to them
  • iterating the while loop. In this loop print the message "body" and Read the value by the user in the "number" variable. This loop will be executed repeatedly until the user do not read the negative value.
  • After the execution of the while loop, it prints the message "Done".
4 0
1 year ago
Which of the following is an advantage of inserting a page number field in your document rather than inserting each page number
Artyom0805 [142]

The advantage of inserting the page number field is that the page number field could show the current page number.

The following information should be relevant with respect to the page number:

  • The page number field & the actual page number should be formatted.
  • The page number field & the actual page number both could be inserted into the header or footer.
  • The page number field & the actual page number could be easily inserted into the document.

Therefore we can conclude that the advantage of inserting the page number field is that the page number field could show the current page number.

Learn more about the page number here: brainly.com/question/3063419

8 0
1 year ago
A ______________ deals with the potential for weaknesses within the existing infrastructure to be exploited.
algol [13]

Answer:

Threat assessment

Explanation:

A threat assessment deals with the potential for weaknesses within the existing infrastructure to be exploited.

Threat Assessment is further explained as the practice of determining or ascertaining the credibility and seriousness of a potential threat, and also the probability or chases of the threat will becoming a reality.

Threat assessment is separate to the more established procedure of violence-risk assessment, which seek to forcast an individual's general capacity and tendency to respond to situations violently. Instead, threat assessment aims to interrupt people on a route to commit "predatory or instrumental violence, the type of behavior connected with targeted attacks".

3 0
2 years ago
Read 2 more answers
What protocol communicates data between routers representing the edges of autonomous systems?Distance-vectorLink stateInterior g
Nata [24]

Explanation:

Exterior gateway protocol are the routing protocols that are used on the internet for exchanging routing information among the autonomous system. These autonomous systems can be gateway protocol, vector routing protocol.

8 0
2 years ago
Other questions:
  • In the game Beehive, you play the role of a worker bee who must watch over her hive. Your duties include (among others) directin
    12·2 answers
  • In which of these places might you be most likely to find a peer-to-peer network? On the Internet In a hospital In a home In a l
    5·2 answers
  • Copy the 10 statements as they appear below into your journal.
    6·2 answers
  • Someone else can drive your car if _____.
    12·2 answers
  • Define a method named roleOf that takes the name of an actor as an argument and returns that actor's role. If the actor is not i
    8·1 answer
  • An entrepreneur is opening a computer store in a small town and wants to display a few laptops in the store, but is concerned ab
    11·2 answers
  • A triangular number is a number that is the sum of the integers from 1 to some integer n. Thus 1 is a triangular number because
    11·1 answer
  • Read the four detective reports and the combined affidavit and warrant for the M57 Patents case. Write a one- to two-page paper
    5·1 answer
  • Java Programming home &gt; 1.14: zylab training: Interleaved input/output Н zyBooks catalog Try submitting it for grading (click
    6·1 answer
  • Write a method called printRangeOfNumbers that accepts a minimum, maximum numbers as parameters and prints each number from mini
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!