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
lesantik [10]
3 years ago
9

Topic: Pseudo-codes

Computers and Technology
1 answer:
Arisa [49]3 years ago
7 0

Answer:

//program_start

//variable_inicialization

books = 0

maps = 0

magazines = 0

//End variable_inicialization

//operation_selection_routine

display "Select operation: (I) for input item to stock, (O) for output items in stock

operation = read_keyboard_input

IF (operation = "I")

goto input_routine

ELSE IF (operation = "O")

goto output_routine

ELSE

display "Incorrect option, try again"

goto operation_selection_routine

ENDIF

//End operation_selection_routine

//input_routine

display "Insert item code to add to stock"

input_code = read_keyboard_input

IF (input_code >= 1000 & input_code < 2000)

IF (input_code NOT duplicated_in_stock)

 add_to_stock (input_code)

 books = books + 1

 display "Book added"

ELSE

 display "Item Code is already present in stock"

ENDIF

ELSE IF (input_code >= 2000 & input_code < 3000)

IF (input_code NOT duplicated_in_stock)

 add_to_stock (input_code)

 maps = maps + 1

 display "Map added"

ELSE

 display "Item Code is already present in stock"

ENDIF

ELSE IF (input_code >= 3000 & input_code < 4000)

IF (input_code NOT duplicated_in_stock)

 add_to_stock (input_code)

 magazines = magazines + 1

 display "Magazine added"

ELSE

 display "Item Code is already present in stock"

ENDIF

ELSE IF (input_code = 9999)

goto program_end

ELSE

display "Incorrect option, try again"

goto input_routine

ENDIF

goto operation_selection_routine

//End input_routine

//output_routine

display "Items in stock"

display "Number of books: " + books

display "Number of maps: " + maps

display "Number of magazines: " + magazines

goto operation_selection_routine

//End output_routine

//program_end

display "Terminating stock program"

stop_program

Explanation:

Pseudo code is a way to design an algorithm using normal words and terms, that are not specific to any programming language. It is easier to understand how the program works and once finished, can be translated to the desired programming language.

This algorithm uses 5 blocks of code:

*variable_inicialization, where item counters are initially set to zero.

*operation_selection_routine, where the program request user input to select if the user will add an item or show existing items in stock. If an incorrect option is given, it will repeat this same routine.

*input_routine, the program will request the four digit code to add, and will check if it is not already present (to avoid duplicated items), and if the item code belongs to a book, map or magazine, increasing the corresponding item counter. Also, if the code is 9999 it will go to the program_end routine, otherwise it will display an error message and request a new item code. After a valid item code it will return to the operation_selection_routine.

*output_routine, it will display on screen the number of items for each category. Then, returns to the operation_selection_routine.

*program_end, it will simply display a goodbye message and terminate the program.

You might be interested in
In which of the following situations would you want to use a word processing template?
creativ13 [48]
<h2>Answer:</h2>

<u>The correct answer is A. </u><u>You need to write a letter to a company you’d like to work with, and have specific questions to ask.</u>

<h2>Explanation:</h2>

Applying for a job is a very formal type of document which contains all the required and necessary information about a person who wants to apply. So a letter is typed in Microsoft word format to keep the document aligned and beautiful. Word template can make it professional which otherwise becomes hard to apply for a job in the absence of quality editing.

5 0
4 years ago
Read 2 more answers
To change the backround color of a page, which tab would you use?
ivann1987 [24]
I have concluded the answer is a
4 0
3 years ago
Read 2 more answers
1. Before operating any power tool, you need to
Anna007 [38]

Answer:

where glasses gloves turn on the power tool

Explanation:

7 0
3 years ago
Which storage device would you most likely use to share a file with a classmate?
valina [46]
You’d probably use a USB Flash Drive.
6 0
4 years ago
Read 2 more answers
Allows a service provider organization to own and manage the infrastructure (including computing, networking, and storage device
djverab [1.8K]

Answer:

The answer is "Public Cloud computing".

Explanation:

It is a type of technology that focusing on domain-specific resources rather than using dedicated servers or intelligent machines. All services are provided as well as used throughout the Network and per user are paid, and certain options were wrong which can be described as follows:

  • In option 1, it is used to describe the details, it doesn't store data.
  • In option 2, It is used in the organization.
  • In option 3, It is used for courts or legal documentations.
7 0
4 years ago
Other questions:
  • Which of the following accurately completes this sentence? The Internet is ____.
    6·2 answers
  • How do you change the text style on brainly mobile ?
    12·1 answer
  • How does Technology impact any profession or occupation?
    5·1 answer
  • Which wireless communication is typically limited to six feet of distance?
    14·1 answer
  • Sam has created a fashion website. There are many subscribers to his website. He has added new blogs, pictures, and articles abo
    13·1 answer
  • Natalie is a secretary and must complete a large amount of filing this afternoon. At 1:00 PM, the office receptionist gets sick
    10·1 answer
  • Help giving points mark BRAINLEST
    5·1 answer
  • If your pulse is higher than your Target Heart Rate during exercise, what should you do?
    5·2 answers
  • Liam noticed someone had accessed his social media account and made several posts without his knowledge. Which of the following
    13·1 answer
  • What stipulates that the source code of any software published under its license must be freely available.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!