just realized these 2 homework assignments are due in 13 hrs and i havent even started.
i am paying 400fg for each assignment and if you have done anything in C++ they will probably take 20 minutes each (most likely less)!
please post first in this thread if you are going to do either assignment 1 or assignment 2 so that we dont have 2 people doing the same assignment and ill end up having to pay 2 people for the same work.assignment 1:Note: In every exercise, you are expected to test your program to make sure it works before going to the next one. If it doesn’t, you need to fix it; you can always ask for help.
Write a short program that prompts the user and reads in integers into an array called Table. When the user enters a negative number, the input stops. Keep track of how many numbers were read in (at least 5 and no more than 10; what size should you declare the array to have?)
Then add code to do the following:
1. Print how many numbers were read in, and then print out all the numbers that were stored in the array. (Same as last lab)
2. Find and print the average. (Again, done last week.) Then find and print how many of the numbers are less than the average calculated above, how many are exactly the same value as the average, and how many were greater than the average. Test and make sure it works.
3. Ask the user for a value and see if it is in the array. If found, the program should print “Found at” followed by the index where the value was found. Ask the user whether to repeat and keep repeating if the user wants to. (What kind of a loop statement would be good? The body of the loop would be:
Asking user for a value and reading it in.
Searching for the value in the array and printing either “Not found.” or “Found at index ….”. Asking user whether to continue and reading in the answer.)
Test using different values. At a minimum, test using the following values:
1) value not in the array.
2) the first value of the array,
3) the last value in the array
4) value in the array somewhere between the first and the last values.
4. Find and print the smallest value in the array AND the index where it is located. Then write code that will swap the smallest value and the first value in the array.
Have the program checked by the instructor or the lab assistant and submit to Titanium.
Extra only if you want to try it:
Write a program that will fill in an array with numbers and then sort the numbers in the array. Print out the content before sorting and again after sorting. Don’t try and find code for sorting. Think of how you can do this with what you already know.
assignment 2:Programming Assignment #6
Arrays
In this assignment you will read in and analyze temperatures around the nation on a particular day. The input data will be in a text file called temperature.txt. The first line of the file will be a date; this can be read in as a string. This will be followed by an integer that gives the number of locations at which the temperatures were taken; this will be at least 2 and no more than 100. This is followed by that many lines (2 to 100), where each line has two integers representing the daily high and the daily low at one location. A short sample content of temperature .txt is given below.
The program should first read in the data from the file. Use two arrays, one to hold the high temperatures and the other to hold the low temperatures. Once the data has been read in, do the following analysis:
1. Find the average high and the average low for the day. Calculate the averages real numbers that will be displayed to 1 decimal point.
2. Find the highest and the lowest temperature in the nation for the day.
Print the information in a readable format to a file “report.txt”, starting with a title with the date. See sample below. Once your program is working correctly, use the temperature.txt file posted on Titanium as input and turn in the resulting report.txt.** (see below the table)
Extra challenge: For the high temperatures only, calculate and draw a histogram. This means counting the number of temperatures that were less than 0, how many in the range 0 to 9, how many in the range 10 to 19, … how many in the range 90 to 99, and how many were 100 or above. The counts must be in an array of size 12, one entry for the 12 ranges given. The counts should be plotted in a simple graph with a row of *’s giving the count in each range. You may assume that the number of counts in any range will be less than the standard width for the output. See the example below for the given sample input
Extra extra challenge: Try doing the above *without* using a big “if.. else if else..” or a case statement to find which count [i] needs to be increased for a particular temperature.
Please turn in:
1. Pseudocode
2. Your program including the following internal documentation:
a) Your name, section number, date, assignment number

description of the purpose of the program
3. The output file “report.txt”.
Sample contents of temperature.txt
March 3, 2010
5
45 17
72 54
58 45
21 -2
41 28
Sample content of report.txt:
Temperatures on March 3, 2010
Average high: 47.4 F
Average low: 28.4 F
Highest temperature for the day: 72 F
Lowest temperature for the day: -2 F
For extra challenge:
Histogram of high temperatures:
vertical axis: range of temperatures
horizontal axis: number of temperatures in that range
< 0|
<= 9|
<=19|
<=29|*
<=39|
<=49|**
<=59|*
<=69|
<=79|*
<=89|
<=99|
>99|
(Hint for printing out labels: If you want to print out a set of string constants, you can store them in an array and then print them out from the array. Example
string grade_level [4] = {"Freshman", "Sophomore", "Junior", "Senior"};
for (int level = 0; level < 4; level++)
cout << grade_level[level] << endl;
**use the temperature.txt file posted on Titanium as input and turn in the resulting report.txt. (here is the table)
April 6, 2013
24
88 72
52 36
73 48
89 72
97 84
61 41
48 37
68 45
88 63
79 52
48 21
55 46
54 41
97 81
55 37
79 70
72 43
68 45
102 80
57 39
37 32
45 28
66 45
59 36