#Name: Thomas Hunter #Email: thomas.hunter1870@myhunter.cuny.edu #Date: August 27, 2019 #This program prints: Hello, World! print("Hello, World!")
Submit the following programs via Gradescope:
Write a program that prints "Hello, World!" to the screen.
Hint: See the introductory lab.
Write a program that draws an octagon (8-sided polygon).
Note: Choose a name for your file that is not turtle.py.
When executing the "import turtle" statement, the computer first looks in the folder where the file is saved for the turtle module and then in the libraries (and other places on the path). So, it thinks the module is itself, causing all kinds of errors. To avoid this, name your program something like "myTurtle.py" or "program2.py".
Hint: See the introductory lab.
Copy the program from Section 4.3 into a file on your computer and modify the program (with turtles alex and tess) to have a blue background color and have tess draw red lines:
Write a program that implements the pseudocode ("informal high-level description of the operating principle of a computer program or other algorithm") below:
Repeat 36 times: Walk forward 100 steps Turn left 55 degrees Walk forward 10 steps Turn left 55 degrees Walk forward 100 stepsYour output should look similar to:
Write a program that will prints your name 25 times.
For example, the output of Thomas Hunter's program should be:
Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter Thomas Hunter
Note: the grading scripts expect the name associated with your Gradescope account (down to spaces and punctuation). If you get an error that the names do not match, compare carefully the name you printed and the name on file. If your name is not correct on Gradescope, send email to hunterCSci127help AT gmail.com with the correct name.
Write a program that prints out the numbers from 0 to 24.
The output of your program should be:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Using the string commands introduced in Lab 1, write a Python program that prompts the user for a message, and then prints the message, the message in upper case letters, and the message in lower case letters.
A sample run of your program should look like:
Enter a message: Mihi cura futuri Mihi cura futuri MIHI CURA FUTURI mihi cura futuri
Another run:
Enter a message: I love Python! I love Python! I LOVE PYTHON! i love python!
Hint: Your program should be able to take any phrase the user enters and prints it, it in upper case letters, and it in lower case letters. To do that, you need to store the phrase in a variable and print variations of the stored variable.
Write a program that prompts the user to enter a phrase and then prints out the ASCII code of each character in the phrase.
A sample run of your program should look like:
Enter a phrase: I love Python! In ASCII: 73 32 108 111 118 101 32 80 121 116 104 111 110 33
And another sample run:
Enter a phrase: ABC In ASCII: 65 66 67
Hint: If c is a character, ord(c) returns its ASCII code. For example, if c is 'I', then ord(c) returns 73. See Lab 1.
(The cipher disk above shifts 'A' to 'N', 'B' to 'O', ... 'Z' to 'M', or a shift of 13. From secretcodebreaker.com.)
Write a program that prompts the user to enter a word and then prints out the word with each letter shifted right by 13. That is, 'a' becomes 'n', 'b' becomes 'o', ... 'y' becomes 'l', and 'z' becomes 'm'.
Assume that all inputted words are in lower case letters: 'a',...,'z'.
A sample run of your program should look like:
Enter a word: zebra Your word in code is: mroen
Hint: See the example programs from Lecture 2.
Write a program that prompts the user for a DNA string, and then prints the length and GC-content (percent of the string that is C or G, written as a decimal).
A sample run of your program should look like:
Enter a DNA string: ACGCCCGGGATG Length is 12 GC-content is 0.75
And another sample run:
Enter a DNA string: AAAAA Length is 5 GC-content is 0.0
Hint: See Lab 1.
Write a program that asks the user for a noun and two verbs (inspired by a Colgate University COSC 101 program). Using the words the user entered, print out a new sentence of the form:
If it VERB1 like a NOUN and VERB2 like a NOUN, it probably is a NOUN.A sample run of the program:
Enter a noun: duck Enter a verb: walks Enter another verb: talks New sentence: If it walks like a duck and talks like a duck, it probably is a duck.Another sample run of the program:
Enter a noun: cat Enter a verb: sounds Enter another verb: moves New sentence: If it sounds like a cat and moves like a cat, it probably is a cat.
Hint: Here's a way to approach the problem:
Modify the program from Lab 2 to show the shades of blue.
Your output should look similar to:
Write a program that asks the user for a name of an image .png file and the name of an output file. Your program should create a new image that has only the blue channel of the original image (that is, no green channel).
A sample run of your program should look like:
Enter name of the input file: csBridge.png Enter name of the output file: blueH.png
Sample input and resulting output files:
Note: before submitting your program for grading, remove the commands that show the image (i.e. the ones that pop up the graphics window with the image). The program is graded on a server on the cloud and does not have a graphics window, so, the plt.show() and plt.imshow() commands will give an error. Instead, the files your program produces are compared pixel-by-pixel to the answer to check for correctness.
Hint: See Lab 2.
In Lecture 3, we wrote a program to make a Hunter logo 'H' on a 10x10 grid. Write a program that creates a 'C' logo for CUNY on a 30x30 grid.
The grading script is expecting:
Note: before submitting your program for grading, remove the commands that show the image (i.e. the ones that pop up the graphics window with the image). The program is graded on a server on the cloud and does not have a graphics window, so, the plt.show() and plt.imshow() commands will give an error. Instead, the files your program produces are compared pixel-by-pixel to the answer to check for correctness.
Hint: See notes from Lecture 3.
Modify the flood map of NYC from Lab 3 to color the region of the map with elevation greater than 6 feet and less than or equal 20 feet above sea level the color grey (50% red, 50% green, and 50% blue).
Your resulting map should look like:
and be saved to a file called floodMap.png.
Note: before submitting your program for grading, remove the commands that show the image (i.e. the ones that pop up the graphics window with the image). The program is graded on a server on the cloud and does not have a graphics window, so, the plt.show() and plt.show() commands will give an error. Instead, the files your program produces are compared pixel-by-pixel to the answer to check for correctness.
Write a program that converts kilometers to miles. Your program should prompt the user for the number of kilometers and then print out the number of miles.
A useful formula: miles = 0.621371* kilometers.
See Lab 3 for designing Input-Process-Output programs.
Write a program that implements the pseudocode below:
1. Ask the user for the number of seconds until lecture starts. 2. Print out the hours until lecture (hours = seconds //3600). 3. Compute the remaining seconds (rem = seconds % 3600). 4. Print out the minutes until lecture (minutes = rem // 60). 5. Print out the remaining seconds (remSec = rem % 60).
A sample run of your program should look like:
Enter number of seconds: 62 Hours: 0 Minutes: 1 Seconds: 2
and another sample run:
Enter number of seconds: 4000 Hours: 1 Minutes: 6 Seconds: 40
Hint: See Section 2.7.
Write a program that asks the user for 5 whole (integer) numbers. For each number, turn the turtle left the degrees entered and then the turtle should move forward 100.
A sample run of your program should look like:
Enter a number: 270 Enter a number: 100 Enter a number: 190 Enter a number: 200 Enter a number: 80
and the output should look similar to:
Write a program that asks the user for a message and then prints the message out, three copies of one character per line.
A sample run of your program should look like:
Enter a message: I love Python! I I I l l l o o o v v v e e e P P P y y y t t t h h h o o o n n n ! ! !
And another sample run:
Enter a message: Hunter H H H u u u n n n t t t e e e r r r
Note: The print() command can take multiple inputs to print at the same time. For example, print(c,c) will print the contents of variable c twice. For example, if Hint: See Lab 1 or Lecture 2 notes.
Write a program that prompts the user to enter a list of names. Each person's name is separated from the next by a semi-colon and a space ('; ') and the names are entered lastName, firstName (i.e. separated by ', '). Your program should then print out the names, one per line, with the first initial of the first name, followed by ".", and followed by the last name.
A sample run of your program should look like:
Hint: See Section 10.24 for a quick overview of split(). Do this problem in parts: first, split the list by person (what should the delimiter be?). Then, split each of person's name into first and last name (what should the delimiter be here?). If you have a string str, what is s = str[0] + "."?
Write a program that implements the pseudocode below:
Hint: See examples of range(start,stop,step) in Lecture 2 notes.
Following Lab 4, write a program that asks the user for the name of a .png file and print the number of pixels that are nearly white (the fraction of red, the fraction of green, and the fraction of blue are all above 0.75).
For example, if your file was of the snow pack in the Sierra Nevada mountains in California in September 2014:
then a sample run would be:
Note: for this program, you only need to compute the snow count. Showing the image will confuse the grading script, since it's only expecting the snow count.
Write a logical expression that is equivalent to the circuit that computes the majority of 3 inputs, called in1, in2, in3:
Save your expression to a text file.
See Lab 4 for the format for submitting logical expressions to Gradescope.
Modify the map-mapking program from Lab 3 to create a topographic map (highlighting the points that have elevations that are multiples of 10). Your program should ask the user for the amount of blue (a floating point number between 0.0 and 1.0), the name of the output imagee, create a new image with thaht name and with the pixels colored as follows:
A sample run of your program should look like:
Your resulting map should look like:
and be saved to a file called medBlue.png.
Note: before submitting your program for grading, remove the commands that show the image (i.e. the ones that pop up the graphics window with the image). The program is graded on a server on the cloud and does not have a graphics window, so, the plt.show() and plt.imshow() commands will give an error. Instead, the files your program produces are compared pixel-by-pixel to the answer to check for correctness.
Build a circuit that has the same behavior as a NAND gate (i.e. for the same inputs, gives identical output) using only AND, OR, and NOT gates.
Save your expression to a text file.
See Lab 4 for the format for submitting logical expressions to Gradescope.
Modify the program from Lab 5 that displays the NYC historical population data. Your program should ask the user for the borough, an name for the output file, and then display the fraction of the population that has lived in that borough, over time.
A sample run of the program:
The file qFraction.png:
Note: before submitting your program for grading, remove the commands that show the image (i.e. the ones that pop up the graphics window with the image). The program is graded on a server on the cloud and does not have a graphics window, so, the plt.show() and plt.imshow() commands will give an error. Instead, the files your program produces are compared pixel-by-pixel to the answer to check for correctness.
Write a program that computes the minimum, average, and maximum population over time for a borough (entered by the user). Your program should assume that the NYC historical population data file, nycHistPop.csv is in the same directory.
A sample run of your program:
and another run:
Hint: See Lab 5.
Write an Unix shell script that prints Hello, World to the screen.
Submit a single text file containing your shell commands. See Lab 5 for details.
In Lab 5, you created a github account. Submit a text file with the name of your account. The grading script is expecting a file with the format:
Note: it takes a few minutes for a newly created github account to be visible. If you submit to gradescope and get a message that the account doesn't exist, wait a few minutes and try again.
The program, turtleString.py (available at:
https://github.com/stjohn/csci127) takes a string as input and uses that string to control what the turtle draws on the screen (inspired by code.org's graph paper programming). Currently, the program processes the following commands:
Modify this program to allow the user also to specify with the following symbols:
Hint: See Lecture 4 notes.
Using pandas, write a program that asks the user for a recipe (in comma separated value (CSV) format), reads in the corresponding CSV file and prints out quantities and ingredients needed to make a double batch. Assume that the CSV files have the columns: "Amount", "Measurement", and "Ingredient".
For example if the CSV file, meringues.csv, contained:
A sample run of your program would be:
Modify the program from Lab 6 that displays shelter population over time to:
A sample run of the program:
which produces an output:
Note: The grading script is expecting that the label (i.e. name of your new column) is "Fraction Children".
Write a program, using a function main() that prints "Hello, World!" to the screen. See Lab 6.
Logical gates can be used to do arithmetic on binary numbers. For example, we can write a logical circuit whose output is one more than the inputted number. Our inputs are in1 and in2 and the outputs are stored in out1, out2, and out3.
Here is a table of the inputs and outputs:
Submit a text file with each of the outputs on a separate line:
Note: here's a quick review of binary numbers.
Modify the parking ticket program from Lab 7 to do the following:
A sample run:
And another run:
Write a program that asks the user for a CSV of the NYC OpenData Film Permits:
A sample run:
This assignment uses film permit data collected and made publicly by
New York City Open Data, and can be found at:
Hint: See Lab 7 for accessing and analyzing structured data.
Write a program that implements the pseudcode below. Your program should ask the user for a binary number and print out the corresponding decimal number.
A sample run of the program:
And another sample run of the program:
Fill in the missing function, num2string(), in the program, numsConvert.py (available at:
https://github.com/stjohn/csci127). The function should take number between 0 and 9 as a parameter and returns the corresponding number as a string. For example, if the parameter is 0, your function should return "zero". If the parameter is 1, your function should return out "one", etc.
Note: The grading scripts are expecting that your function is called num2string(). You need to use that name, since instead of running the entire program, the scripts are "unit testing" the function-- that is, calling that function, in isolation, with differrent inputs to verify that it performs correctly.
Hint: See notes from Lecture 7 and Lab 7.
Write a function, computeFare(), that takes as two parameters: the zone and the ticket type, and returns the Copenhagen Transit fare.
A template program, copenhagenTransit.py, is available on the
CSci 127 repo on github.
The grading script does not run the whole program, but instead tests your function separately ('unit tests') to determine correctness. As such, the name of the function must match exactly (else, the scripts cannot find it).
A sample run:
And another:
Hint: See Lab 7.
In Lab 6, we worked through a program that displayed the homeless shelter occupancy over time. The same approach can be used for displaying any dataset where the date and time are stored. For this program, use the lab as a starting point to display public school attendance from NYC OpenData. If you would like to test your program on other data, you can filter for an individual school by viewing the data and filtering on the school number ("School DBN"). Export the file as CSV and save. There is a sample file for the high school on campus on
github
Modify the program from Lab 6 that displays shelter population over time to:
A sample run of the program:
which produces an output:
Note: The grading script is expecting that the label (i.e. name of your new column) is "% Attending" and the range of values be between a percentage between 0 and 100 (hint: would do you multiply by to convert a fraction into a percentage?).
Write two functions, triangle() and nestedTriangle(). Both functions take two parameters: a turtle and an edge length. The pseudocode for triangle() is:
The pseudocode for nestedTriangle() is very similar:
A template program, nestingTrianges.py, is available on the
CSci 127 repo on github.
The grading script does not run the whole program, but instead tests your function separately ('unit tests') to determine correctness. As such, the function names must match exactly (else, the scripts cannot find it). Make sure to use the function names from the github program (it is expecting triangle() and nestedTriangle()).
A sample run:
which would produce:
Fill in the missing functions:
The functions are part of a program that averages smaller and smaller regions of an image until the underlying scene is visible
(inspired by the elegant koalas to the max).
For example, if you inputted our favorite image, you would see (left to right):
and finally:
A template program, averageImage.py, is available on the
CSci 127 repo on github.
The grading script does not run the whole program, but instead runs each of your functions separately ('unit tests') to determine correctness. As such, the names of the functions must match exactly the ones listed above (else, the scripts cannot find them).
Hint: See notes from Lecture 8.
Fill in the missing function to animate hurricane data (inspired by the 2018 Nifty Hurricane Program by Phil Ventura). Your function, animate(t,lat,lon,wind) takes as input:
Your function should move to the turtle to the current location (longitude, latitude), and then based on the
Saffir-Simpson Hurricane Wind Scale, change the turtle to be:
A template program, hurricane.py, and background image, mapNASA.gif, are available on the
CSci 127 repo on github.
The grading script does not run the whole program, but instead runs each of your functions separately ('unit tests') to determine correctness. As such, the names of the functions must match exactly the ones listed above (else, the scripts cannot find them).
Two test files (irma.csv and jose.csv) are from the Nifty site. Additional CSV files are available there.
Hint: You may find the following turtle commands useful: color(), goto(), and pensize().
Write a program that uses folium to make a map of New York City. Your map should be centered at (40.75, -74.125) and include a marker for the main campus of Hunter College. The HTML file your program creates should be called: nycMap.html
Hint: See Lab 8.
Using folium (see Lab 8), write a program that asks the user for the name of a CSV file, name of the output file, and creates a map with markers for all the traffic collisions from the input file.
A sample run:
which would produce the html file:
(The demo above is for October 18, 2016 using the time the collision occurred ("TIME") to label each marker and changed the underlying map with the option:
tiles="Cartodb Positron" when creating the map.)
This assignment uses collision data collected and made publicly by
New York City Open Data.
A sample file, collisionsThHunterBday.csv from 18 October 2016 was downloaded and can be used to test your program.
Note: when creating datasets to test your program, you will need to filter for both date (to keep the files from being huge) and that there's a location entered. The former is explained above; to check the latter, add the additional filter condition of "LONGITUDE is not blank".
Hint: For this data set, the names of the columns are "LATITUDE" and "LONGITUDE" (unlike the previous map problem, where the data was stored with "Latitude" and "Longitude").
The program,
errorsHex.py, has lots of errors. Fix the errors and submit the modified program.
Hint: See Lab 8.
Modify the program from Lab 9 that makes a turtle walk 100 times. Each "walk" is 30 steps forward and the turtle can turn left 0,10,20,...,350 degrees (chosen randomly) at the beginning of each walk.
A sample run of your program:
Write a program that asks the user to enter their age. If the user enters negative number, your program should continue prompting the user for a positive number until they enter a one. Your program should then print out the number entered.
A sample run of your program:
Hint: See Lab 9.
Write an Unix shell script that does the following:
Hint: See Lab 10.
Write a simplified machine language program that prints: Hello, World!
See Lab 10 for details on submitting the simplified machine language programs.
Hint: You may find the following table useful:
Hint: The grading scripts are matching the phrase exactly, so, you need to include the spacing and punctuation.
Write a simplified machine language program that has register $s0 loop through
the numbers 2, 4, 6, 8, ..., 20.
See Lab 10 for details on submitting the simplified machine language programs.
Using Unix shell commands, write a script that counts the number of .py files in current working directory.
Hint: See Lab 10.
Write a C++ program that prints "Hello, World!" to the screen.
Hint: See Lab 11 for getting started with C++.
Write a C++ program that will print "I love C++" 14 times.
The output of your program should be:
Hint: See Lab 11 for getting started with C++.
Write a C++ program that converts farenheit to celsius. Your program should prompt the user for the degrees in farenheit and then print out the temperature in celsius.
A useful formula: celsius = (farenheit - 32.0) * (5.0/9.0).
Please include the decimal digit in your formula (.0) and output with See Lab 3 for designing Input-Process-Output programs and Lab 11 for getting started with C++.
Write a C++ program program that asks the user for two numbers x and y, and draws a grid of zeros and ones with x rows and y columns using 'character graphics'.
A sample run:
Another sample run:
Hint: if your nested loops have index variables, i and j, then what does: cout << ((i+j+1)%2) do?
Write a C++ program that asks the user for their average grade and prints
A sample run:
Another sample run:
And another run:
Write a C++ program that asks the user for their weekly salary, and continue asking until the number entered is positive (that is, greater than 0).
A sample run:
Hint: The logic here is similar to the Python program
from Lab 9 in C++.
Write a C++ program that asks the user for an initial dollar amount. It then repeatedly asks for the amount spent and reports on the remaining amount, until it runs out of money.
A sample run:
Hint: Use an indefinite loop and continue looping while the amount is is greater than 0.
Write a C++ program that asks the user for a whole number between -31 and 31 and prints out the number in "two's complement" notation, using the following algorithm:
A sample run:
Another run:
Please enter your list of names: Cohn, Mildred; Dolciani, Mary P.; Rees, Mina; Teitelbaum, Ruth; Yalow, Rosalyn
You entered:
M. Cohn
M. Dolciani
M. Rees
R. Teitelbaum
R. Yalow
Thank you for using my name organizer!
For i = 90, 88, 86, 84, 82, ... ,0:
Walk forward 25 steps
Turn left i degrees
Your output should look similar to:
Enter file name: caDrought2014.png
Snow count is 38010
How blue is the ocean: 0.5
What is the output file: medBlue.png
Thank you for using my program!
Your map is stored medBlue.png.
Enter borough name: Queens
Enter output file name: qFraction.png
Enter borough: Staten Island
Minimum population: 727
Average population: 139814.23076923078
Maximum population: 474558
Enter borough: Brooklyn
Minimum population: 2017
Average population: 1252437.5384615385
Maximum population: 2738175
#Name: Your name
#Date: November 2017
#Account name for my github account
AccountNameGoesHere
For example, if the user enters the string "FLFLFLFL^FFFvFLFLFLFL", the turtle would move forward and then turn left. It repeats this 4 times, drawing a square. Next, it lifts the pen and move forward 3, puts the pen back down and draw another square.
Amount Measurement Ingredient
150 grams chocolate chips
4 whites of eggs
.25 teaspoon vanilla
.25 teaspoon cream of tartar
Enter recipe name: meringues.csv
Double your recipe is:
Amount Measurement Ingredient
0 300.0 grams chocolate chips
1 8.0 whites of eggs
2 0.5 teaspoon vanilla
3 0.5 teaspoon cream of tartar
Enter name of input file: DHS_2015_2016.csv
Enter name of output file: dhsPlot.png
(click to launch new window with circuit)
Inputs Outputs
Decimal
Numberin1 in2 Decimal
Numberout1 out2 out3
0 0 0 1 0 0 1
1 0 1 2 0 1 0
2 1 0 3 0 1 1
3 1 1 4 1 0 0
#Name: YourNameHere
#Date: November 2017
#Logical expressions for a 4-bit incrementer
out1 = ...
out2 = ...
out3 = ...
Where "..." is replaced by your logical expression (see Lab 4).
Enter file name: Parking_Violations_Jan_2016.csv
Enter attribute: Vehicle Color
The 10 worst offenders are:
WHITE 2801
WH 2695
GY 1420
BK 1153
BLACK 1054
BROWN 727
BL 656
GREY 574
SILVE 450
BLUE 412
Name: Vehicle Color, dtype: int64
Enter file name: Parking_Violations_Jan_2016.csv
Enter attribute: Vehicle Year
The 10 worst offenders are:
0 3927
2015 1265
2014 1143
2013 1105
2012 772
2011 666
2007 643
2008 559
2010 509
2006 499
Name: Vehicle Year, dtype: int64
Your program should then print out:
Enter file name: filmPermitsJune2019.csv
There were 643 film permits.
Manhattan 336
Brooklyn 165
Queens 70
Staten Island 42
Bronx 30
Name: Borough, dtype: int64
The five most popular filming locations were:
WEST 48 STREET between 6 AVENUE and 7 AVENUE 25
EAST 140 STREET between LOCUST AVENUE and WALNUT AVENUE, WALNUT AVENUE between EAST 139 STREET and EAST 140 STREET, EAST 139 STREET between WALNUT AVENUE and LOCUST AVENUE 15
FROST STREET between DEBEVOISE AVENUE and MORGAN AVENUE, DEBEVOISE AVENUE between FROST STREET and RICHARDSON STREET 11
ASHLAND PLACE between LAFAYETTE AVENUE and HANSON PLACE 10
EAST 11 STREET between 3 AVENUE and 4 AVENUE, 3 AVENUE between EAST 11 STREET and EAST 12 STREET 9
Name: ParkingHeld, dtype: int64
https://data.cityofnewyork.us/City-Government/Film-Permits/tg4x-b46p.
Since the files are quite large, use the "Filter" option and a range of dates for "StartDateTime" and "Export" (in CSV format) all permits for those dates.
Ask user for input, and store in the string, binString.
Set decNum = 0.
For each c in binString,
decNum = decNum * 2
if c is 1, then
decNum = decNum + 1
Print decNum
Enter binary number: 10
Your number in decimal is 2
Enter binary number: 1111
Your number in decimal is 15
Enter the number of zones: 3
Enter the ticket type (adult/child): Adult
The fare is 34.5
Enter the number of zones: 2
Enter the ticket type (adult/child): child
The fare is 11.5
df["Date"] = pd.to_datetime(df["Date"].apply(str))
Enter name of input file: dailyAttendanceManHunt2019.csv
Enter name of output file: manHunt.png
triangle(t, length):
1. If length > 10:
2. Repeat 3 times:
3. Move t, the turtle, forward length steps.
4. Turn t left 120 degrees.
5. Call triangle with t and length/2.
nestedTriangle(t, length):
1. If length > 10:
2. Repeat 3 times:
3. Move t, the turtle, forward length steps.
4. Turn t left 120 degrees.
5. Call nestedTriangle with t and length/2.
Enter edge length: 160
Enter CSV file name: collisionsThHunterBday.csv
Enter output file: thMap.html
Enter your age: -100
You entered a negative number. Try again.
Enter your age: -17
You entered a negative number. Try again.
Enter your age: 19
You entered: 19
Submit a single text file containing your shell commands. See Lab 10.
(Image from wikimedia commons)
I love C++
I love C++
I love C++
I love C++
I love C++
I love C++
I love C++
I love C++
I love C++
I love C++
I love C++
I love C++
I love C++
I love C++
cout << fixed << ...
to enforce output with decimal places even when 0
Enter the number of rows: 3
Enter the number of columns: 6
101010
010101
101010
Enter the number of rows: 3
Enter the number of columns: 3
101
010
101
Enter your average grade: 93.6
Your letter grade is A
Enter your average grade: 79.8
Your letter grade is C or D
Enter your average grade: 80.8
Your letter grade is B
Please enter your salary: -900
Entered a negative number.
Please enter your salary: -90.0
Entered a negative number.
Please enter your salary: 900
Your weekly salary is $900
Please enter the initial dollar amount:100
Please enter the amount you spent:13.5
You now have $86.5 remaining
Please enter the amount you spent:34
You now have $52.5 remaining
Please enter the amount you spent:26.9
You now have $25.6 remaining
Please enter the amount you spent:500
You now have $-474.4 remaining
Your initial amount has been entirely spent
Enter a number: 8
001000
Enter a number: -1
111111