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
What are hard ware and software requirments in multimedia computer system
marishachu [46]

Answer:

Some hardware requirement: Monitor, keyboard, mouse, sound card, memory, processor, graphics display card. Some software requirement: Windows XP/Vista, Video for Windows, Quicktime.

Explanation:

BRAINLEST

4 0
3 years ago
What are spreadsheets in a excel workbook called? A. pages B. notepads C.graphs D.worksheets
galina1969 [7]
D. Worksheets
I’m positive this is the correct answer
4 0
3 years ago
Quick Search lets you refine or narrow your search results using links on the right side of the screen. Do a search on nano-mate
Fofino [41]

Answer:

C. by topic.

D. by collection.

4 0
3 years ago
Print 'userNum1 is negative" if userNum1 is less than 0. End with newline Convert userNum2 to 0 if userNum2 is greater than 9. O
dlinn [17]

Answer:

#include <stdio.h>

int main()

{

   int userNum1;

   int userNum2;

   

   userNum1 = -1;

   userNum2 = 7;

   

   if (userNum1 < 0)

       printf("userNum1 is negative. \n");

       

   if(userNum2 > 9)

       userNum2 = 0;

   else

       printf("userNum2 is less than or equal to 9.\n");

   return 0;

}

Explanation:  

Initialize userNum1 and userNum2.

If userNum1 is less than 0, print 'userNum1 is negative" and end with newline.

if userNum2 is greater than 9, assign 0 to userNum2.

Otherwise, print "userNum2 is less than or equal to 9 and end with newline.

8 0
3 years ago
A constructor can be overloaded with more than one function which has the same name but with what two different things
andreyandreev [35.5K]
<h2>Answer:</h2>

i. Number of parameters

ii. Type of parameters

<h2>Explanation:</h2>

When there are two or more constructors, definitely with the same name, in a given class, then the constructors are said to be overloaded. An overloaded constructor appears declared many times in a class but each time with different number of parameters and/or type of parameters.

For example, given a class Test, the following combination of constructors can exist;

i. public Test(int x){

   

 }

ii. public Test(String m){

     

  }

iii. public Test(int a, String b){

 

}

<em>The following should be noted;</em>

In the case of combination (i) and (ii), the constructors have the same number of parameters but different type of parameter. In other words, they both have 1 parameter but while the first one has a parameter type of <em>int</em>, the second has a parameter type of <em>String</em>.

In the case of combination (ii) and (iii), the constructors have different number of parameters and of course different type of parameters. In other words, the second constructor has 1 parameter of type <em>String</em> while the third constructor has 2 parameters of types <em>int</em> and <em>String</em>.

5 0
3 years ago
Other questions:
  • True or false: a cover letter accompanies a resume to showcase a job-seeker’s personal life
    6·2 answers
  • After the following code is executed what will be displayed on the screen? bool correntEmployee = true; double empSalary = 45000
    7·1 answer
  • A network administrator has been creating a baseline of network performance. During this process, he realizes that one router is
    14·1 answer
  • Which component of the windows desktop allows you to retrieve files that have recently been deleted?
    11·1 answer
  • In what year did the manager and team depicted in the blockbuster film "Moneyball
    9·1 answer
  • What are copyright laws? Authority to reprint an original work as long as it's not for profit Entitlement to use and sell anothe
    15·2 answers
  • What is the ability for a system to respond to unexpected failures or system crashes as the backup system immediately and automa
    8·1 answer
  • The birthday problem is as follows: given a group of n people in a room, what is the probability that two or more of them have t
    12·1 answer
  • What is one problem caused by spending too much time studying at your computer? A. It increases stress and negatively affects yo
    8·1 answer
  • This question involves the creation and use of a spinner to generate random numbers in a game. a gamespinner object represents a
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!