Writing a program in COBOL.

Write the following program using COBOL programming language:

Grade Report

This is a program designed to hit you where you live! This program will compute your current average in a class, the minimum average that you could earn from this point forward, and the maximum average that you can earn. In addition to this, it prints the relative weights of each assignment category.

This program assumes that grades are computed out a fixed pool of points. For example, the course in which you currently find yourself has 1000 points. Your total average is computed by the formula:

grade = (points_earned * 100) / points_possible

So at any given point in the semester, you could compute your current average by totaling the points you have earned and dividing by the possible points on your assignments so far.

The minimum grade is what you would earn if you stopped handing in work. That is, you would forfeit all remaining possible points in the semester (not a good idea, usually!)

The maximum grade is what you would earn if you earned all remaining possible points in the semester.

This program will take as its input the name of a file. The file is a flat-format file of the following form:

The total number of points for the entire semester on a line by itself.

Zero or more assignment records, with each field being a fixed width. The format of these records are as follows:

Assignment Name (20 characters)

Category (20 characters)

Possible Points (14 characters)

Earned Points (14 characters)

Consider the file generated by a student whom we will call “Bill”. Bill has recorded his first few as shown:

1000

MS 1 – Join Grps    Group Project       5             5             

Four Programs       Programming         15            9             

Quiz 1              Quizzes             10            7             

FORTRAN             Programming         25            18            

Quiz 2              Quizzes             10            9             

HW 1 – Looplang     Homework            20            15            

Note that there is no separator between these fields! If they use the full width of the field, they run right up to the next one:

HW 3 – Struct & VarsHomework            20            20            

When Bill runs the program, it generates the following output:

File: Bill

Group Project        (5%)

==================================

MS 1 – Join Grps        5/5   100%

==================================

                        5/5   100%

Homework             (23%)

==================================

HW 1 – Looplang       15/20    75%

==================================

                      15/20    75%

Programming          (47%)

==================================

Four Programs          9/15    60%

FORTRAN               18/25    72%

==================================

                      27/40    67%

Quizzes              (23%)

==================================

Quiz 1                 7/10    70%

Quiz 2                 9/10    90%

==================================

                      16/20    80%

Current Grade: 74%

Minimum Total Grade: 6%

Maximum Total Grade: 97%

Here, neatness counts! Make the output line up in nice neat tables. Also note that category weights are the weight of how much the category counts toward the current average. At the end of the course, these would match the weights in the syllabus. Also, note that while Bill is earning a C, if he buckles down he can still get that A. Perhaps you could use this program to help you in your courses!

The contents of sample data files are given below:

File bill:

1000

MS 1 – Join Grps Group Project 5 5   

Four Programs Programming 15 9   

Quiz 1 Quizzes 10 7   

FORTRAN Programming 25 18

Quiz 2 Quizzes 10 9   

HW 1 – Looplang Homework 20 15

File cs-390 assignments:

1000

MS 1 – Join Grps Group Project 5 0   

Four Programs Programming 15 0   

Quiz 1 Quizzes 10 0   

FORTRAN Programming 25 0   

Quiz 2 Quizzes 10 0   

HW 1 – Looplang Homework 20 0   

COBOL Programming 25 0   

Quiz 3 Quizzes 10 0   

Mid Mid 200 0   

HW 2 – LL Enhanced Homework 20 0   

ALGOL 68 Programming 25 0   

MS 2 – Descr. Lang. Group Project 50 0   

HW 3 – Struct & VarsHomework 20 0   

Lua Programming 25 0   

Quiz 4 Quizzes 10 0   

HW 4 – Variable Typ.Homework 20 0   

MS 3 – Example ProgsGroup Project 45 0   

JavaScript Programming 25 0   

Quiz 5 Quizzes 10 0   

HW 5 – Smalltalk Homework 20 0   

MS 4 – Interpreter Group Project 100 0   

Ms 5 – Presentation Group Project 50 0   

Scheme Programming 25 0   

Quiz 6 Quizzes 10 0   

Prolog Programming 25 0   

Final Final test 200 0

Draw a diagram

  

  1. This      is problem 5.13 from your text book. You can use any Free UML tool      (see the list on the Moodle or Visio software tool) You need to draw a UML      diagram for a system.

Consider a hospital’s patient monitoring system. Each patient is connected to machines monitoring blood pressure, heart rate, and EKG. These machines issue a Boolean signal indicating a FAIL or WORKING condition. The results of each of these machined are ‘ORed’ together to form a signal called ALARM. The ALARM signals for each of the rooms (one patient per room) are then ‘ORed’ together and sent to the nurse’s station. If any machine on any patient indicates a failure, the emergency alarm is sounded and the nurse is directed to the appropriate patient and machine. Draw a data flow diagram/ UML diagram for such a system.

final case

 

Chapter 5 exercises

20. Consider the task of building a classifier from random data, where the attribute values are generated randomly irrespective of the class labels. Assume the data set contains records from two classes, “+” and “−.” Half of the data set is used for training while the remaining half is used for testing.

(a) Suppose there are an equal number of positive and negative records in the data and the decision tree classifier predicts every test record to be positive. What is the expected error rate of the classifier on the test data?

(b) Repeat the previous analysis assuming that the classifier predicts each test record to be positive class with probability 0.8 and negative class with probability 0.2.

(c) Suppose two-thirds of the data belong to the positive class and the remaining one-third belong to the negative class. What is the expected error of a classifier that predicts every test record to be positive?

(d) Repeat the previous analysis assuming that the classifier predicts each test record to be positive class with probability 2/3 and negative class with probability 1/3.

Chapter 6 exercises

5. Prove Equation 6.3 in the book. (Hint: First, count the number of ways to create itemset that forms the left hand side of the rule. Next, for each size k itemset selected for the left-hand side, count the number of ways to choose the remaining d − k items to form the right-hand side of the rule.)

17. Suppose we have market basket data consisting of 100 transactions and 20 items. If the support for item a is 25%, the support for item b is 90% and the support for itemset {a, b} is 20%. Let the support and confidence thresholds be 10% and 60%, respectively.

(a) Compute the confidence of the association rule {a} -> {b}. Is the rule interesting according to the confidence measure?

(b) Compute the interest measure for the association pattern {a, b}. Describe the nature of the relationship between item a and item b in terms of the interest measure.

(c) What conclusions can you draw from the results of parts (a) and (b)?

(d) NOT NEEDED FOR THE TEST

Chapter 7 exercises

5. For the data set with the attributes given below, describe how you would convert it into a binary transaction data set appropriate for association analysis. Specifically, indicate for each attribute in the original data set.

(a) How many binary attributes it would correspond to in the transaction data set,

(b) How the values of the original attribute would be mapped to values of the binary attributes, and

(c) If there is any hierarchical structure in the data values of an attribute that could be useful for grouping the data into fewer binary attributes. The following is a list of attributes for the data set along with their possible values. Assume that all attributes are collected on a per-student basis:

• Year : Freshman, Sophomore, Junior, Senior, Graduate: Masters, Graduate: PhD, Professional

• Zip code : zip code for the home address of a U.S. student, zip code for the local address of a non-U.S. student

• College : Agriculture, Architecture, Continuing Education, Education, Liberal Arts, Engineering, Natural Sciences, Business, Law, Medical, Dentistry, Pharmacy, Nursing, Veterinary Medicine

• On Campus : 1 if the student lives on campus, 0 otherwise

• Each of the following is a separate attribute that has a value of 1 if the person speaks the language and a value of 0, otherwise.

- Arabic
- Bengali
- Chinese Mandarin
- English
- Portuguese
- Russian
- Spanish

Chapter 8 exercises

1. Consider a data set consisting of 2^(20) data vectors, where each vector has 32 components and each component is a 4-byte value. Suppose that vector quantization is used for compression and that 2^(16) prototype vectors are used. How many bytes of storage does that data set take before and after compression and what is the compression ratio?

8. Consider the mean of a cluster of objects from a binary transaction data set. What are the minimum and maximum values of the components of the mean? What is the interpretation of components of the cluster mean? Which components most accurately characterize the objects in the cluster?

9. Give an example of a data set consisting of three natural clusters, for which (almost always) K-means would likely find the correct clusters, but bisecting K-means would not.

11. Total SSE is the sum of the SSE for each separate attribute. What does it mean if the SSE for one variable is low for all clusters? Low for just one cluster? High for all clusters? High for just one cluster? How could you use the per variable SSE information to improve your clustering?

13. The Voronoi diagram for a set of 1( points in the plane is a partition of all the points of the plane into K regions, such that every point (of the plane) is assigned to the closest point among the 1( specified points. (See Figure 8.38.) What is the relationship between Voronoi diagrams and K-means clusters? What do Voronoi diagrams tell us about the possible shapes of K-means clusters?