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
In mathematics, "quadrant I" of the cartesian plane is the part of the plane where x and y are both positive. Given a variable,
lbvjy [14]

Answer:

#include <iostream>

using namespace std;

struct Cartesian {

double x;

double y;

};

int main() {

// creating a pointer p of type struct Cartesian

struct Cartesian *p = new Cartesian ;

cout << " Enter x: ";

// accessing the structure variable x by arrow "->"

cin >> p->x;

cout << "Enter y: ";

// accessing the structure variable y by arrow "->"

cin >> p->y;

// expression to check whether x and y lie in Quadrant 1

if (p->x > 0 && p->y > 0) {

 cout << "X and Y are in Quadrant 1 ";

}

else

{

 cout << "x And y are not in Quadrant 1";

}

// deleting the struct pointer p

delete p;

return 0;

}

Explanation:

in order to locate memory in heap, keyword "new" is used in C++ so,

struct Cartesian *p = new Cartesian ;

in order to access data members of the structure using pointer we always use an arrow "->". otherwise a dot oprerator is used to access data members.

in order to check whether x and y lie in 1st quadrent, we must use && operator in our if condition. so

if (p->x > 0 && p->y > 0)

&& will return true iff x and y both are +ve.

deleting the struct pointer p is important beacuse we are allocating memory in heap so heap memory should be used a resource and must be release when not needed otherwise it can cause memory leakage problems. so  

delete p;

5 0
3 years ago
Given the function F (X, Y , Z)=Σm(0,1, 2 , 4 , 6)
Mnenie [13.5K]

Answer:

(1)Minterms complement = XYZ (2) Compliment of Minterms = Σm(0,1, 2 , 4 , 6) (3) (X+Y+Z) (4) Minimized SOP = Z + XY

Manterms = πM

Explanation:

Solution

Recall that:

Given the function F (X, Y , Z)=Σm(0,1, 2 , 4 , 6)

(1) Canonical Disjunctive Normal Form: In boolean algebra, the boolean function can be expressed as Canonical Disjunctive form known as minterms

In Minterm we assign 'I' to each uncomplimented variable and '0' to each complemented/complementary variable

For the given question stated we ave the following:

Minterms = XYZ, XYZ, XYZ, XYZ, XYZ.

(2) Canonical Conjunctive Normal Form: In boolean algebra, the boolean function can be expressed as Canonical Disjunctive form known as maxterms.

In Maxterms we assign '0' to each uncomplimented variable and '1' to each complemented/complementary variable

Compliment of Minterms = Σm(0,1, 2 , 4 , 6)

Maxterms = πM

Note: Kindly find an attached copy of the complete solution to this question below.

6 0
2 years ago
In many DBMSs where no strict separation of levels is maintained, this one language is used by the DBA and database designers to
marissa [1.9K]

Answer: False

Explanation:

This means that the mappings between the two schemas may be specified in either one of these languages.In most relational DBMSs today, there is no specific language that performs the role of SDL. Instead, the internal schema is specified by a combination of functions, parameters, and specifications related to storage. These permit the DBA staff to control indexing choices and mapping of data to storage

5 0
3 years ago
Technology can help governments handle economic emergencies, such as the reliance on automation. Crop and resource shortages. Th
uranmaximum [27]

Answer

Technology can help government handle economic emergencies such as crop and resource shortages.

Explanation

The government can address the concerns of food shortages and water scarcity through embracing new technology interventions to increase farm yields and mitigate the impacts of water shortages. Through crop protection methods, weeds and pest can be controlled. Drip irrigation technology applies water directly to the roots of crops to facilitate high crop production. Other technologies to apply can include organic agriculture and integrated soil fertility management.



3 0
3 years ago
Read 2 more answers
I had about 83 GB before I installed Xcode, I was in the middle of the installation and reconsidered my decision but it's still
Natasha_Volkova [10]

You can try downloading some kind of computer cleaner like CleanMyMac X free version, also definitely restart your computer if you haven't done so already.

4 0
2 years ago
Read 2 more answers
Other questions:
  • The n modifier after the tilde forces the index variable to expand only to the ______
    15·1 answer
  • Please help with this
    5·2 answers
  • Triangle O N M is cut by line segment L K. Line segment L K goes from side N O to side N M. The length of N L is x, the length o
    8·2 answers
  • W-11/6=4<br><img src="https://tex.z-dn.net/?f=%20%20%5Cfrac%7Bx%20-%2011%20%7D%7B%206%7D%20%20%3D%204" id="TexFormula1" title="
    14·1 answer
  • 3. What are the first steps that you should take if you are unable to get onto the Internet? (1 point)
    15·1 answer
  • what version of the internet do we use as an interactive social system in which users are able to interact with senders
    7·1 answer
  • A _______ policy states that the company may access, monitor, intercept, block access, inspect, copy, disclose, use, destroy, or
    5·1 answer
  • What is computer code?<br> A. Java Script<br> B. XML<br> C. HTML<br> D. Any programming language
    6·1 answer
  • What caused accident? into passive voice​
    13·1 answer
  • View One | View All
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!