subject

A. The file USPopulation. txt is provided with this assignment. The file contains the midyear population of the United States, in thousands, during the years 1950 through 1990. The first line in the file contains the population for 1950, the second line contains the population for 1951, and so forth. Write a program that will a. Read the file contents into a list named population and create two additional lists: i. A list named year with a list of the years from 1950 to 1989 ii. A list named pop_changes which stores the population changes from one year to the next. The change is the difference from one year to the next. The first change is for the year 1950 and is 2114 (153982 in 1951 minus 151868 in 1950). b. Display: i. the average population during the time period 1950 to 1990 ii. the overall population change from 1950 to 1990 iii. The average annual change in population during the time period iv. The year with greatest change in population during the time period v. The year with smallest change in population during the time period c. Prompt the user to input a year. Report: i. the population for that year ii. the change from the previous year iii. the change for the following year

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:00, kimmmmmmy333
According to alisa miller foreign news bureaus
Answers: 3
image
Computers and Technology, 22.06.2019 20:00, bowmanari2154
What is used to analyze and summarize your data without graphical support
Answers: 1
image
Computers and Technology, 23.06.2019 11:30, talyku7131
Me dangers of social media and the internetexplain what each means: 1) social media and phones have become an addiction.2) outside people have access to you all the time.3) cyberstalking4) cyberbullying5) catphishing6) viruses7) identity theft8) credit card fraud9) hacking10) money schemes
Answers: 1
image
Computers and Technology, 23.06.2019 19:00, brittneyrenae7338
This question involves a class named textfile that represents a text file. public class textfile { private string filename; private string filename; private arraylist words; // constructors not shown // postcondition: returns the number of bytes in this file public int filesize() { } // precondition: 0 < = index < words. size() // postcondition: removes numwords words from the words arraylist beginning at // index. public void deletewords(int index, int numwords) { } // precondition: 0 < = index < = words. size() // postcondition: adds elements from newwords array to words arraylist beginning // at index. pub lic voidaddwords(int index, string[] newwords) { } // other methods not shown } complete the filesize() method. the filesize() is computed in bytes. in a text file, each character in each word counts as one byte. in addition, there is a space in between each word in the words arraylist, and each of those spaces also counts as one byte. for example, suppose the words arraylist stores the following words: { mary had a little lamb; its fleece was white as snow. } the filesize() method would compute 4 + 3 + 1 + 6 + 5 + 4 + 6 + 3 + 5 + 2 + 5 as the sum of the lengths of each string in the arraylist. the value returned would be this sum plus 10, because there would also be 10 spaces in between the 11 words. complete the filesize() method below: // postcondition: returns the number of bytes in this file public int filesize() { }
Answers: 1
You know the right answer?
A. The file USPopulation. txt is provided with this assignment. The file contains the midyear popula...

Questions in other subjects:

Konu
Social Studies, 21.09.2021 02:20
Konu
English, 21.09.2021 02:20
Konu
Mathematics, 21.09.2021 02:20
Konu
Physics, 21.09.2021 02:20