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
umka2103 [35]
3 years ago
9

Create and code a program that uses three parallel numeric arrays of size 7. The program searches one of the arrays and then dis

plays the corresponding values from the other two arrays. The program should prompt the user to enter a Part Number. Valid Part Numbers should be the numbers 17, 22, 38, 46, 51, 63, and 84. The program should search the array for the Part Number in the Part Number array and display the corresponding price and quantity from the prices and quantities arrays. Populate the prices and quantities arrays with any values you want. Price should allow for two decimal places. Allow the user to display the price and quantity for as many Part Numbers as desired without having to execute the program again. Of course, any bad Part Numbers should display an error message, but the user should be able to continue until a sentinel is entered. The program should be structured to work with any numbers should the company decide to change Part Numbers in the future. In other words, do not hard code the Part Number search with if or switch statements, actually search or move through the Part Number array to find a match.
Computers and Technology
1 answer:
Keith_Richards [23]3 years ago
5 0

Answer:

Using C++, the  generated from the algorithm created in the explanation box is here by attached to this answer.

Explanation:  

To create the program, you need to analyse and design a solution before coding.  

Problem Analyses:

  • Input-The program requires the user to enter the part number to be searched and also a control number(sentinel) to allow user to continue searching. Therefor, 2 inputs are required.
  • Output-The program will display at least the part number entered, the corresponding price and quantity as the final output.
  • Process-The process that will convert the input to output will involve creating the 3 required array to store part numbers, price and quantity. There after, a search will be performed on the part number array to match and retrieve the corresponding price and quantity from their respective arrays.

Pseudo code

  • Initialize variables and the 3 arrays:run,value,i,partnum[],price[],quantity[],size
  • While run remains 'c'
  • Get value
  • Open for loop
  • If value is same as array index i
  • Print part number,price and quantity
  • Break from for loop
  • end if
  • Else if at the end of the search there is no value matching any part number
  • print not available      
  • Break
  • End esle if        
  • Update run                
  • End while
  • End program
Download pdf
You might be interested in
Innovation made from establishment of abucas to the present 5th
Minchanka [31]

Answer:

Douglas-fir, spruce, true fir, beech, and maple are toward the top of the list for oxygen release.Douglas-fir, spruce, true ...

4 0
3 years ago
Special computers, called __________, keep databases of IP addresses and their corresponding names
vitfil [10]
Name servers.
-----------------------------------------------------------
4 0
2 years ago
Read the excerpt below and answer the question.
zysi [14]

Answer:

Agreed

Explanation:

8 0
3 years ago
Write pseudocode for brushing your teeth using at least four steps.
Paha777 [63]

Answer: Start rinsing your teeth and gums with help of brush in a circular way.

Explanation:

6 0
3 years ago
4. The clutch pedal is found in cars with manual and automatic transmissions.
kicyunya [14]
False. The clutch only exists in vehicles with manual transmissions.
8 0
3 years ago
Other questions:
  • What is the equivalent of film speed in digital cameras?
    6·2 answers
  • Windows enables each user to establish a ____, which identifies to windows the resources, such as apps and storage locations, a
    6·1 answer
  • How do you spell kiss in Japanese
    13·2 answers
  • Which type of market are you in if your firm, along with three other firms, controls 95% of the total music industry?
    13·1 answer
  • Which are aspects of the post-production stage?
    9·1 answer
  • Login
    11·1 answer
  • Blockquote
    11·1 answer
  • Sistem komponen mekanikal yang terdapat pada sebuah basikal?​
    13·1 answer
  • I need help with this question.
    15·1 answer
  • The cathode ray tube eventually was eventually used for what entertainment device?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!