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
Additional Engineering Textbook Solutions
Elementary Surveying: An Introduction To Geomatics (15th Edition)
INTERNATIONAL EDITION---Engineering Mechanics: Statics, 14th edition (SI unit)
Starting Out With Visual Basic (8th Edition)
Starting Out with C++ from Control Structures to Objects (9th Edition)
Starting Out with Python (4th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
- 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_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_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
- Geometric 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_forwardA Personal Fitness Tracker is a wearable device that tracks your physical activity, calories burned, heart rate, sleeping patterns, and so on. One common physical activity that most of these devices track is the number of steps you take each day. The steps.txt file contains the number of steps a person has taken each day for a year. There are 365 lines in the file, and each line contains the number of steps taken during a day. (The first line is the number of steps taken on January 1st, the second line is the number of steps taken on January 2nd, and so forth.) Write a program that reads the file, then displays the average number of steps taken for each month. (The data is from a year that was not a leap year, so February has 28 days.) You don't need to see the file , Just write a code using the "file" like this def main(): with open("steps.txt", "r") as file: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
- python languagearrow_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_forwardIN C LANGUAGE Create a structure called employee that holds information like employee code, name, date of joining, department, designation. Write a program to declare 10 employees using array and enter some data into it. Then ask the user to enter the current date. Display and write in a file named “ emp.txt” the records of those employees who are working for 3 or more than 3 years according to the given current date.arrow_forward
- PYTHON PROGRAMMING LANGUAGE Create a new text document called names.txt (this is done by hand - not using programming) with the following names: Adam, Bryan, Charlie. Each name should be followed by a hard return (do not store them in a list). Main Function. Write a program where the user enters a name. Using the read function, check to see if the name is in the text document. If it is, respond back to the user the name is found within the list. Read Function. The read function should return the contents of the text document as a list. Write Function. The write function should take the list and override the file with the new names list in reverse alphabetical order with a hard return after each name. EXAMPLEPlease enter a name: AdamAdam is found in the list.Enter another name (Y/N): YPlease enter a name: AndrewSorry, Andrew was not found in the list. Would you like to add it? (Y/N): YAndrew has been added to the list.Enter another name (Y/N): N LIST EXAMPLEadambryancharlie Final…arrow_forwardGirlNames.txt This file contains a list of the 200 most popular names given to girls born in the United States from the year 2000 through 2009. BoyNames.txt This file contains a list of the 200 most popular names given to boys born in the United States from the year 2000 through 2009. Write a program that reads the contents of the two files into two separate lists. The user should be able to enter a boy’s name, a girl’s name, or both, and the application will display messages indicating whether the names were among the most popular. **programming language is python** ** must use a def main(): function** *please include some comments* i aslo have the .txt files but no wya to upload themarrow_forwardChrome Capture 767x397 Create a python program called code.py. Write a function named pi_multiples() that takes an integer parameter num. This function repeatedly asks the user to enter an integer between 2 and 50. Assume the user will always enter an integer, but if the number is outside this range, the loop must end. So, for any integer x entered within the range, your function must do the following; if x is divisible by num (the parameter), it must multiply x by the value of pi (call it result) and maintain a sum of these results. In every iteration of the loop your function must print x and the result. And when the loop terminates your function should return the sum. To test your function, call pi_multiples() function using any integer number of your choice (for num) and print the returned value. Hint: to use the pi value do the following import math and use math.pi for the value of pi. frames: 0 0/ 10 secs Zip your file, name it code.zip, and submit it using the link available in…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