Using Files—Population Bar Chart
Write a
Here is an example of how the chart might begin:
PRAIRIEVILLE POPULATION GROWTH
(each * represents 1000 people)
1910 **
1930 ****
1950 *****
Want to see the full answer?
Check out a sample textbook solutionChapter 5 Solutions
Starting Out With C++: Early Objects (10th Edition)
Additional Engineering Textbook Solutions
Java: An Introduction to Problem Solving and Programming (8th Edition)
Computer Science: An Overview (12th Edition)
Starting Out With Visual Basic (8th Edition)
Starting Out with Python (3rd Edition)
Absolute Java (6th Edition)
Software Engineering (10th Edition)
- // This pseudocode should create a list that describes annual profit // statistics for a retail store. Input records contain a department // name (for example, ìCosmeticsî) and profits for each quarter for // the last two years. The program should determine whether // the profit is higher, lower, or the same // for this full year compared to the last full year. start Declarations string department num salesQuarter1ThisYear num salesQuarter2ThisYear num salesQuarter3ThisYear num salesQuarter3ThisYear num salesQuarter1LastYear num salesQuarter2LastYear num salesQuarter3ThisYear num salesQuarter4LastYear num totalThisYear num totalLastYear string status num QUIT = "ZZZZ" housekeeping() while department <> QUIT compareProfit() endwhile finishUp() stop housekeeping()DEBUG04-02.txt output "Enter department name or ", QUIT, " to quit " input dept return compareProfit()…arrow_forwardDebug thisarrow_forwardCPP File #include "result.h"#include "Date.h" Result::Result(){m_name = "";m_unitID = "";m_credits = 0;m_mark = 0.0;m_day = 0;m_month = "";m_year = 0;} Result::Result( string name, string id,unsigned credits, double M , unsigned d, string m, unsigned y){m_name = name;m_unitID = id;m_credits = credits;m_mark = M;m_day = d;m_month = m;m_year = y;} istream & operator >>( istream & input, Result & RE){string strInput; getline(input,strInput, ','); RE.SetUnitID(strInput);getline(input, strInput, ','); RE.SetName(strInput);getline(input, strInput, ','); RE.SetCredits(stoi(strInput));getline(input, strInput, ','); RE.SetMark(stod(strInput));getline(input,strInput, ','); RE.SetDay(stoi(strInput));getline(input, strInput, ','); RE.SetMonth(strInput);getline(input, strInput, ','); RE.SetYear(stoi(strInput));getline(input, strInput, ','); return input;} ostream & operator <<( ostream & os,const Result & RE ){string unitID;string name;string month;double mark;…arrow_forward
- CPP File #include "result.h"#include "Date.h" Result::Result(){m_name = "";m_unitID = "";m_credits = 0;m_mark = 0.0;m_day = 0;m_month = "";m_year = 0;} Result::Result( string name, string id,unsigned credits, double M , unsigned d, string m, unsigned y){m_name = name;m_unitID = id;m_credits = credits;m_mark = M;m_day = d;m_month = m;m_year = y;} istream & operator >>( istream & input, Result & RE){string strInput; getline(input,strInput, ','); RE.SetUnitID(strInput);getline(input, strInput, ','); RE.SetName(strInput);getline(input, strInput, ','); RE.SetCredits(stoi(strInput));getline(input, strInput, ','); RE.SetMark(stod(strInput));getline(input,strInput, ','); RE.SetDay(stoi(strInput));getline(input, strInput, ','); RE.SetMonth(strInput);getline(input, strInput, ','); RE.SetYear(stoi(strInput));getline(input, strInput, ','); return input;} ostream & operator <<( ostream & os,const Result & RE ){string unitID;string name;string month;double mark;…arrow_forwardAverage Number of WordsIf you have downloaded the source code from the Computer Science Portal you will find a filenamed text.txt in the Chapter 08 folder. The text that is in the file is stored as one sentenceper line. Write a program that reads the file’s contents and calculates the average number ofwords per sentence.(You can access the Computer Science Portal at www.pearsonhighered.com/gaddis.)arrow_forwardProblem Definition You are provided with a text file (employees.txt) containing a number of text lines. Each line contains a record of one employee. Each record has three attributes: Title: string, Prof. (Professor) or Dr. (Doctor). First and Last names: string. Salary: float number. The attributes are separated by the character (',). Figure 1.a, 1.b, and 1.c show a sample of employees.txt files. Dr., Julia Scott, 141518 Dr., Julia Scott, 141518 Prof.,Joan Stewart, 111673 Mr.,Ali Al-shukaili,122311 Prof., Sana Al-Abri, 131673 Prof.,Joan Stewart Dr., Fadi A1-Rasdhi, 153790 Ms., Salwa Al-Youssfi, 111675 Dr., Daniel Cooper, 153790 Dr., Lillian Brown, unknown Dr. :Benjamin Russell:117642 Dr., Daniel Cooper, 153790 Dr., Lillian Brown, 67251 Dr., Benjamin Russell,117642 Prof., Patrick Bailey, 72305 Dr., Ralph Flores, 118457 Dr., Douglas Flores, 181793 Dr., Lillian Brown, 67251 Figure 1.b: A sample of the text file 'employees.txt" Figure 1.a: A sample of the text file 'employees.txt' without…arrow_forward
- PYTHON QUESTION ASSIGNMENT REQUIREMENTS This assignment requires a dictionary of state abbreviations and their capital cities. The abbreviations are the keys and the state capitals are the values. Start by entering data for any four states of your choice. Then, report this count but use a function to get the count. Use a while loop to add more abbreviations and capitals. The loop should continue until the user presses Enter when prompted for an abbreviation. Inside the while loop: If the state entered is already in the dictionary, report its capital. If it is not in the dictionary, prompt the user to enter the capital for that state and add it to the dictionary After the while loop ends: Report again the count of the number of states in the dictionary. Using another loop and the items() method, display all the state abbreviations and their capitals. In the same Python program write this code, although it has nothing to do with the states code. Using a dictionary…arrow_forwardGeometric Progression Printer As you might recall, a Geometric Progression (or GP) is a sequence of elements in which the next number in the sequence is obtained by multiplying the previous number by the common ratio. The next number in the sequence is obtained by using this formula: a_na_1* r(n-1) While the sum of all numbers in the sequence is obtained using any of these formulae: If r 1, sum = a* n If r != 1 and r> 1, sum= a[(r¹-1)/(r - 1)] If r != 1 and r < 1, sum = a[(1 - r¹)/(1-r)] where a n = next number in the sequence, a_1 = first number in the sequence, r = common ratio, n = number of terms Your task is to write a Python program that 1. Accepts the necessary inputs from the user, i.e., start value (a_1), common ratio (r), and number of generate to generate (n). 2. Generates the Geometric Progression (GP) sequence starting from a_1 to n. 3. Prints out the GP HORIZONTALLY not VERTICALLY, e.g. 3, 9, 27, 81, 243, 729 .... 4. Calculates the sum of all numbers in the GP sequence 5.…arrow_forwardC++ Language Write a program that prints a custom conversion table from Celsius temperatures to Fahrenheit and Newton (Links to an external site.) temperatures. The formula for the conversion from Celsius to Fahrenheit is : F=9/5*C+32 F is the Fahrenheit temperature, and C is the Celsius temperature. The formula for the conversion from Celsius to Newton is C = 100/33*N N is the Newton Temperature and C is the Celsius temperature Your program should prompt the user for a lower value and upper value for a range of temperatures in Celsius. It should then prompt the user for the amount they want to increment by. Then use a loop to output to a file named conversion_table.txt a table of the Celsius temperatures and their Fahrenheit and Newton equivalents within the range of values using the increment given by the user. Make sure to format your output to 2 decimal places. INPUT VALIDATION: Ensure the second number is greater than the first number, and make sure the increment is greater…arrow_forward
- Saving a Document as a Text File Create a function save_document() that accepts the arguments filename and text and saves the text into the file filename. The filename should use the name of the document with ‘_edited_document’ appended to it. For example, for the document text.doc, the save document should have the name text_edited_document.txt. The file should be saved in the folder “edits.” Assume that the folder already exists in the present working directory.arrow_forwardQuestion 14 Write pseudocode OR Python code that contains a While loop that asks the user to enter a number. The loop should iterate 10 times and keep a running total of the numbers entered. Display the total after all values have been totaled. Edit View Inser Format Tools able 12pt Paragrapharrow_forwardUsing python write a program that reads the data from the attached .csv file: Crude0il_20212022.csv. The file contains data regarding the price and volume of Crude Oil traded from August 2021 to July 2022. Once the data has been read, determine and display the following information: The highest and lowest Close/Last price for crude oil for the months of August 2021 through July 2022. Both prices must be displayed with 2 decimal places using an f-string. The number of trading days for the months of August 2021 through July 2022. The total trading volume for the months of August 2021 through July 2022 displayed with the thousands comma separated. The average daily trading volume for the months of August 2021 through July 2022 displayed with the thousands comma separated. Date Close/Last Volume Open High Low 8/2/2021 71.26 429120 73.91 73.95 70.55 8/3/2021 70.56 486786 71.52 71.96 69.19 8/4/2021 68.15 557749 70.32 70.81 67.85 8/5/2021 69.09 397456 68.06 69.35 67.61 8/6/2021 68.28 497049…arrow_forward
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning