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
A recipe for deducing the square root involves guessing a starting value for y. Without another recipe to be told how to pick a
Gnoma [55]

Answer:

TRUE

Explanation:

TRUE - A recipe for deducing the square root involves guessing a starting value for y. Without another recipe to be told how to pick a starting number, the computer cannot generate one on its own.

5 0
3 years ago
PLS HELP!! 50 Points! Will mark correct answer brainliest!!
Illusion [34]

Answer: C

Explanation:

That way she can have slides for her advance class and leave out slides that her normal class doesn’t need

5 0
3 years ago
Read 2 more answers
The space that helps you organize your PowerPoint or Web Page is called ______.
sergeinik [125]

Answer:

the internet

Explanation:

cause I said

8 0
2 years ago
Question 1 of 19
shusha [124]

Answer:

UI Character Presets

Explanation:

User Interface is an option or go-to menu in a desktop application. For example, Photoshop. It allows a user to tweak the outlook to his or her own preference rather than the default settings.

To do this, a user is often tasked to do the following:

1. Click on the "Edit" menu

2. Navigate and click on "Preferences"

3. Select the "Interface" link

The options available to change includes:

a. UI Scaling

b. UI Font Size

c. UI Language.

Hence, in this case, the element that is not a selection in the Interface preferences is "UI Character preset"

7 0
3 years ago
Define a public static method named s2f that takes two String arguments, the name of a file and some text. The method creates th
frez [133]

Answer:

Java solution (because only major programming language that has public static methods)

(import java.io.* before hand)

public static boolean s2f(String fileName, String text){

   try{

       PrintWriter out = new PrintWriter(new File(fileName));

       out.println(text);

       out.close();

       return true;

   }

   catch(Exception e){

       return false;

   }

}

6 0
3 years ago
Other questions:
  • What two terms below describe a network device with three ports, two of which send and receive all traffic, and the third port m
    6·1 answer
  • Which of the following is not a network connection LAN WAN SAN MAN
    6·1 answer
  • A Web ____ is a software program that retrieves the page and displays it. Select one:
    5·1 answer
  • Shakespeare’s complete works have approximately 3.5 million characters. Which is bigger in file size: Shakespeare’s complete wor
    5·2 answers
  • A quick boot allows you to do what?
    7·2 answers
  • Information flows:
    11·1 answer
  • Give an example of a language L such that |L|=5 and |L^2|=16.
    5·1 answer
  • Explain word processing ​
    11·2 answers
  • What function returns a line and moves the file pointer to the next line?
    9·1 answer
  • Prior to the 1996 NEC, ____ receptacles and cords were permitted. However, now it is mandatory that a separate equipment groundi
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!