COSC 1336 Assignments

 

Turn in each Chapter’s assignments together for a grade by the due date.

 

Chapter 1:  Date Due: ________________________

1.            Page 23 #2.  Write your steps to solve the problem on paper.

2.            Page 32 #8.  Write your opinion of this situation on paper.

3.            Program design & Test Data Worksheet (sheet at end of this packet)

Chapter 2:  Date Due: ________________________

1.            Page 57 #3.  Hand in a printout of your C source code and a printout of your program’s output.

2.            Page 73 #4.  Do on paper.

3.            Page 75 #3.  Hand in a printout of your C source code and a printout of your program’s output.

4.            Page 84 #3.  Do on paper.

5.            Page 86 #3 parts a and b.  Hand in a printout of your C source code and a printout of your program’s output.  Include a program design sheet.

Chapter 3:  Date Due: ________________________

1.            Page 114 #2. Hand in a printout of your C source code and a printout of your program’s output.  Include a program design sheet.

2.            Page 119 Programming Exercise #2. Hand in a printout of your C source code and a printout of your program’s output.  Include a program design sheet.

3.            Page 129 #1.  Use a symbolic constant to define pi.  Format your output to have 2 decimal places.  Hand in a printout of your C source code and a printout of your program’s output.  Include a program design sheet.  Complete the table by hand.

Chapter 4:  Date Due: ________________________

1.            Page 165 #1.  Do on paper.

2.            Page 175 #1.  Do on paper.

3.            Page 177 #1 parts a and b.  Hand in a printout of your C source code and a printout of your program’s output.  Include a program design sheet.

4.            Page 195 #1.  You must use a switch statement in the program.  Make sure you include what to do if the user enters an invalid entry.  Hand in a printout of your C source code and a printout of your program’s output.  Include a program design sheet.


Chapter 5:  Date Due: ________________________

1.            Page 223 #3.  Write two versions: one using a while loop, the other using a for loop.  Include a title on each output that has the type of loop.  Hand in a printout of your C source code and a printout of your program’s output.  Include a program design sheet.

2.            Page 261 # 3a.  You MUST use nested loops on this program. Hand in a printout of your C source code and a printout of your program’s output.  Include a program design sheet.

Chapter 6:  Date Due: ________________________

1.            Page 296 #1 a and b. Hand in a printout of your C source code and a printout of your program’s output.  Include a program design sheet for both main & the totamt function.

2.            Create a function to calculate the area of a room.  Input the length and width of the room in the main function and output the area in the main function.  Use different variables for length and width in main and in the function.  Hand in a printout of your C source code and a printout of your program’s output.  Include a program design sheet for both main & the area function.

3.            Page 296 Short Answer Question #2.  Do on paper.

Chapter 7:  Date Due: ________________________

1.            Page 334 #2 a.  Do on paper.

2.            Page 356 #4 – You must use a pointer.  Hand in a printout of your C source code and a printout of your program’s output.  Include a program design sheet for both main & the time function.

3.            Write a function to swap two values using pointers. Write a main functions that inputs two numbers.  Have it call the swap function if the numbers are NOT in descending order – include a loop to allow the user to enter 3 sets of numbers (enter values you need to swap and values you don’t need to swap). Hand in a printout of your C source code and a printout of your program’s output.  Include a program design sheet for both main & the swap function.

Chapter 8:  Date Due: ________________________

1.            Page 385 #2a.  You only need to use 5 numbers. Hand in a printout of your C source code and a printout of your program’s output.  Include a program design. 

2.            Page 396 #4.  Hand in a printout of your C source code and a printout of your program’s output.  Include a program design for both main & the extend functions.


 

Chapter 9:  Date Due: ________________________

1.            Write a complete C program to enter a first name, middle name and last name in separate variable.  The user is to enter the names in all capital letters.  You are to write a function to convert the names to upper first, rest of the letter lower case(JOHNàJohn).  Combine the names into one string and output the string(make sure you have a space between each name).  Count the number of characters in the total name and output that.  Hand in a printout of your C source code and a printout of your program’s output.  Include a program design sheet for both main & the function.

Chapter 10:  Flowchart Date Due:_______________ Program Due: ______

1.            Tax program – see attached page.  DUE LAST CLASS PERIOD BEFORE THE FINAL.  You MUST pseudo code this before coding.  I will go over it in class with you.  The pseudo code must be turned in with the program  It is worth 5% of the program grade.

 

Chapter 11:  Extra Credit – 10 points on one test!  Date Due: _____________

1.            Page 546 Short Answer question #3.  Do on paper.

2.            Page 560 #1  Make sure you use pointers and manipulate the array with them (as shown on page 555).  Hand in a printout of your C source code and a printout of your program’s output.  Include a program design sheet.


1.         Consider a student file that contains the following data:

LAST NAME

FIRST NAME

MAJOR

GRADE PT AVERAGE

Andrews

David

Psychology

3.4

Boederdorf

Melissa

Computer Science

4.0

Brogan

Lindsey

Biology

3.8

Carson

Joshua

Computer Science

2.8

Eisfelder

Katie

Mathematics

3.5

Faris

Natalie

Biology

2.8

Fredricks

Zachary

Psychology

2.0

Gonzales

Eduardo

Biology

3.1

Would this set of data be suitable and sufficient to use to test each of the following programs?  Explain why or why not.

a.                   A program that prints a list of Psychology majors

b.                  A program that prints a list of Art majors

c.                   A program that prints a list of students on academic probation – those with a grade point average under 2.0

d.                  A program that prints a list of students on the dean’s list

e.                   A program that prints a list of students from Wisconsin

f.                   A program that prints a list of female students

2.         You are asked to create a C program that calculates and displays the weekly gross and net pay of employees of a local business.  The employees are paid an hourly rate.  The employees play 20% of their gross pay for income tax and 2% of their gross pay (before taxes) for medical benefits.  Do not write the program to solve this problem – but answer the following questions.

            A.        What would you output for each employee?

            B.        What would you need to input for each employee?

            C.        What formula would you need to convert the input to the output?

3.         What term refers to an electronic device that accepts input, processes data, stores data, and produces output?

A.                   operating system         C.        computer

B.                    hardware                     D.        configuration

4.         What type of software controls basic input and output, allocates system resources, manages storage space, maintains security, and detects equipment failure?

A.          network                       C.        application program

B.          database software       D.        operating system

5.         From the list below, select the application that will best allow you to determine the company inventory items that are currently out-of-stock.

A.          Word                           C.        Access

B.          Excel                           D.        Power Point

6.         What is the difference between moving and copying?

A.    Moving creates an exact duplicate of a file whereas copying copies a file to a new location and erases it from the old location.

B.     Moving copies a file to a new location and erases it from the old location whereas copying creates an exact duplicate of a file.

C.     Moving allows you to move from one directory to another whereas copying allows you to copy from one disk to another.

D.    Moving allows you to move from one disk to another whereas copying allows you to copy from one directory to another.

7.         What alignment is used when full lines of text are spaced between or aligned along both the left and right margins?

A.        center                          C.        justified

B.        left-aligned                  D.        right-aligned

8.         Web pages are ordinary text files formatted according to a generally accepted standard known as:

A.        Web Browser Language

B.        Hypertext Markup Language

C.        Hypermedia Link Language

D.        A standard is not needed.