Docsity

Programming Using C - Homework II | CGS 3460, Assignments of Computer Science

Toggle sidebar
bg1
CGS 3460 - Programming Using C
Summer 2009
Assignment #2
20 Points
Assigned: 05/20/2009, Wed
Due: 05/28/2009, Thu, 11:59 PM
1. (5 Points) Write a program that will read in the number of seconds until the coin
toss at Florida's opening game against Charleston Southern and will print the
number of days, hours, minutes and seconds until the beginning of the season.
Save as p1.c
2. (10 Points) You are taking a class which has 5 assignments, a midterm and a
final. The assignments and the midterm each account for 25% of the final grade.
The final accounts for the remaining 50% of the grade. Write a program that will
prompt the user for the grade received on each homework and the midterm
(assume a scale of 0 to 100 for all grades). It then prompts for a desired grade for
the entire course(say 90), and finally prints the grade needed on the final in order
to get the desired course grade. Save as p2.c
3. (5 Points)Write a simple calculator program. First prompt for two floating point
numbers. Then using a menu, let the user decide which type of operation to
perform between the first and second value(addition, subtraction, multiplication,
division) and print the result. In addition, be sure to check for divide by zero errors.
Save as p3.c
Instructions for submitting Assignment 2
1. First compress your program files into a tar file. For this, change to the directory where
you have stored both the files. At the terminal command prompt (putty, Linux console,
MAC terminal, etc.) type:
tar cvf assign2.tar p1.c p2.c p3.c
Let’s say you have stored your files in assign2 directory on your “rain” machine.
> cd assign2
> ls
p1.c
p2.c
p3.c
..
>tar cvf assign2.tar p1.c p2.c p3.c
>ls
pf2

Partial preview of the text

Download Programming Using C - Homework II | CGS 3460 and more Assignments Computer Science in PDF only on Docsity!

CGS 3460 - Programming Using C

Summer 2009

Assignment # 20 Points Assigned: 05/20/2009, Wed Due: 05/28/2009, Thu, 11:59 PM

  1. (5 Points) Write a program that will read in the number of seconds until the coin toss at Florida's opening game against Charleston Southern and will print the number of days, hours, minutes and seconds until the beginning of the season. Save as p1.c
  2. (10 Points) You are taking a class which has 5 assignments, a midterm and a final. The assignments and the midterm each account for 25% of the final grade. The final accounts for the remaining 50% of the grade. Write a program that will prompt the user for the grade received on each homework and the midterm (assume a scale of 0 to 100 for all grades). It then prompts for a desired grade for the entire course(say 90), and finally prints the grade needed on the final in order to get the desired course grade. Save as p2.c
  3. (5 Points) Write a simple calculator program. First prompt for two floating point numbers. Then using a menu, let the user decide which type of operation to perform between the first and second value(addition, subtraction, multiplication, division) and print the result. In addition, be sure to check for divide by zero errors. Save as p3.c Instructions for submitting Assignment 2
  4. First compress your program files into a tar file. For this, change to the directory where you have stored both the files. At the terminal command prompt (putty, Linux console, MAC terminal, etc.) type: tar cvf assign2.tar p1.c p2.c p3.c Let’s say you have stored your files in assign2 directory on your “rain” machine.

cd assign ls p1.c p2.c p3.c .. tar cvf assign2.tar p1.c p2.c p3.c ls

p1.c p2.c p3.c assign2.tar ….

  1. If you are working from Windows platform using Putty and WinSCP, you can create a directory assign2 in your home directory on rain machine using putty. Create the directory using this command on putty

    cd //to change to the home directory mkdir assign2 //to create the directory under home directory

  2. Then transfer p1.c, p2.c and p3.c to assign2 directory on rain using WinSCP.
  3. Go to step 1 to tar the file using putty.
  4. Use WinSCP to copy assign2.tar from rain machine back to your local computer, say desktop.
  5. Upload the assign2.tar to WebCT.
  6. Please check the discussion page for assignment 2 on WebCT for common questions and their answers.