Lab Assignment 1 CSC435 : Object Oriented Programming
---------------------------------------------------------------------------------
Due Date : 21 October 2011 (Friday)
This is a group assignment of 2 persons in one group.
All groups should submit the soft-copy (before 20 October 2011 into my email) and hardcopy (before 21 October into my pigeon hole) of the assignment including the sample of output for each questions.
Any intention to plagiarism is not allowed for this task and if there is a case of copy and paste of C++ coding, suitable action will be taking against groups such as deduction on marks or ZERO marks will be given.
---------------------------------------------------------------------------------
Task 1 (CO1,CO2)
Implementing Basic JAVA Programming
Write in JAVA for the following problems:
Question 1
(Counting positive and negative numbers and computing the average of numbers) Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, and computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the average as a floating-point number. Here is a sample run:
Enter an int value, the program exits if the input is 0:
1
2
-1
3
0
The number of positives is 3
The number of negatives is 1
The total is 5
The average is 1.25
Question 2
(Game: Scissors, rock, paper) Write a program that plays the popular scissor-rock-paper games. (A scissor can cut a paper, a rock can knock a scissor, and a paper can wrap a rock.) The program randomly generates a number 0,1 or 2 representing scissor, rock and paper. It prompts the user to enter a number 0,1 or 2 and display a message indicating whether the user or the computer wins or draws.
Download the front page cover for Assignment here : [Download]
Download the assignment rubric here : [Download]
Good Luck!
Question 1
(Counting positive and negative numbers and computing the average of numbers) Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, and computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the average as a floating-point number. Here is a sample run:
Enter an int value, the program exits if the input is 0:
1
2
-1
3
0
The number of positives is 3
The number of negatives is 1
The total is 5
The average is 1.25
Question 2
(Game: Scissors, rock, paper) Write a program that plays the popular scissor-rock-paper games. (A scissor can cut a paper, a rock can knock a scissor, and a paper can wrap a rock.) The program randomly generates a number 0,1 or 2 representing scissor, rock and paper. It prompts the user to enter a number 0,1 or 2 and display a message indicating whether the user or the computer wins or draws.
Download the front page cover for Assignment here : [Download]
Download the assignment rubric here : [Download]
Good Luck!