Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please do this in c++ urgent - Practice input and output - Practice using arrays - Practice implementing loops - Practice implementing functions Notes: You

please do this in c++
urgent
image text in transcribed
- Practice input and output - Practice using arrays - Practice implementing loops - Practice implementing functions Notes: You must complete Lab 1 before starting Project 1. This is an individual assignment. Do not share code or look at anyone else's code. You may share ideas with others, but not code. If you share code or collaborate too closely with others your code is very likely to be flagged by our anti-plagiarism checker and you may not receive any credit for your submissions If there are multiple instances of your submissions getting flagged, I have to fail you in the course. Please use common sense and avoid this common pitfall. Overview You will write a program named chart to read a sequence of integers from "standard input", and output a "bar chart" to "standard output", using asterisk and space characters (" "' and " ). The input specifies a sequence of up to 100 intege.s greater than 0 . The last value in the input must be a 0 , indicating that the input is complete. For example, if the input contains the sequence 123432160 then your program must write the following output to "standard out": Note: Space characters are used to output the whitespace in the chart above. There are 8 integers in the input (ignoring the 0 ), so there are 8 vertical "bars" in the bar chart. The height of each veritcal "bar" in the chart above is controlled by each of the integers. The first "bar" is one asterisk tall because the first integer in the input is a 1. The last "bar" is six asterisks tall because the last integer in the input (ignoring the 0) is 6 . Note 1; The only characters output on each line are space (") and asterisk ("). Note 2: You must output the lines of the bar chart in from top to bottom phis is the ony way you can wnite to "standard output"2. Each line is output from left to right. The input might have numbers on separate lines, or on the same Ine separated by "white space". The best way to handle input like this is to use the built-in Ct+ "extraction operator", which reads input delimeted by " "white space". In computer input, "white space" means spaces, tabs and "end of line" characters. This type of input is also known as "token based" input. ...continued an next page

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions