Write a program that will 1. Declare a struct stock a. Name b. Price on Day 1 c. Price on Day 2 d. Percent change 2. Ask the user to input how many stocks he'll enter 3. Input that number 4. Declare a vector of stocks of that inputted number(step 3) 5. Use a loop that for each stock will

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Write a program that will
1. Declare a struct stock
a. Name
b. Price on Day 1
c. Price on Day 2
d. Percent change
2. Ask the user to input how many stocks he'll enter
3. Input that number
4. Declare a vector of stocks of that inputted number(step 3)
5. Use a loop that for each stock will
a. Input:
i. Name of Stock
ii. Price on Day 1
iii. Price on Day 2
b. Compute the Percent change
6. Loop that computes the stock whose percentage change increased
the most
7. Output the stock in the vector whose percent change increased the most
a. Output all contents of the struct
i. Name
ii. Price on Day 1
iii. Price on Day 2
iv. Percent change
See next page for Sample Run:
Transcribed Image Text:Write a program that will 1. Declare a struct stock a. Name b. Price on Day 1 c. Price on Day 2 d. Percent change 2. Ask the user to input how many stocks he'll enter 3. Input that number 4. Declare a vector of stocks of that inputted number(step 3) 5. Use a loop that for each stock will a. Input: i. Name of Stock ii. Price on Day 1 iii. Price on Day 2 b. Compute the Percent change 6. Loop that computes the stock whose percentage change increased the most 7. Output the stock in the vector whose percent change increased the most a. Output all contents of the struct i. Name ii. Price on Day 1 iii. Price on Day 2 iv. Percent change See next page for Sample Run:
C:\Users\hamiscy\Desktop\Final
How many stocks will you enter?
3
Project Environment ConsoleApplication1\Debug\ConsoleApplication1.exe
Input the name of the stock
Company A
Input the price of the stock on day 1
23.67
Input the price of the stock on day 2
25.78
Input the name of the stock
CompanyB
Input the price of the stock on day 1
2.67
Input the price of the stock on day 2
10.8
Input the name of the stock
Company C
Input the price of the stock on day 1
50.8
Input the price of the stock on day 2
120.88
The stock with the greatest percentage increase is:
CompanyB
2.67
10.8
304.494
Press any key to continue
X
Transcribed Image Text:C:\Users\hamiscy\Desktop\Final How many stocks will you enter? 3 Project Environment ConsoleApplication1\Debug\ConsoleApplication1.exe Input the name of the stock Company A Input the price of the stock on day 1 23.67 Input the price of the stock on day 2 25.78 Input the name of the stock CompanyB Input the price of the stock on day 1 2.67 Input the price of the stock on day 2 10.8 Input the name of the stock Company C Input the price of the stock on day 1 50.8 Input the price of the stock on day 2 120.88 The stock with the greatest percentage increase is: CompanyB 2.67 10.8 304.494 Press any key to continue X
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education