How many stocks will you enter? 3 nput the name of the stock CompanyA Input the price of the stock on day 1 23. 67 Ipput the price of the stock on day 2 25.78 Input the name of the stock CompanyB neut the price of the stock on day 1 2.67 Oput the price of the stock on day 2 10.8 Input the name of the stock CompanyC Input the price of the stock on day 1 50.8 Rput the price of the stock on day 2 120.88 The stock with the greatest percent age increase is: CompanyB 2.67 10.8 304.494 Press any key to continue

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
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
ii. 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 ii. 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:
I CAUsers\hamriscy Desktop\Final Project Environment.ConsoleApplicationi\DebugiConsoleApplicationi.exe
How many stocks will you enter?
3
Input the name of the stock
CompanyA
Input the price of the stock on day 1
23.67
IOput 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
Epput the price of the stock on day 2
10.8
Input the name of the stock
CompanyC
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
Transcribed Image Text:I CAUsers\hamriscy Desktop\Final Project Environment.ConsoleApplicationi\DebugiConsoleApplicationi.exe How many stocks will you enter? 3 Input the name of the stock CompanyA Input the price of the stock on day 1 23.67 IOput 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 Epput the price of the stock on day 2 10.8 Input the name of the stock CompanyC 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
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY