
COP2250 – ASSIGNMENT 4
Due Tuesday, March 25th
Instructions:
• A signed statement stating that you have adhered to the collaboration policy for this class
and that what you are presenting is your own work.
• If you have received help from any source other than your class notes or textbook, please
cite the source at the appropriate place. This includes tutorships.
• The assignment should be typed and a stapled hardcopy of the same has to be submitted at
the beginning of the class.
• For programming assignments, submit a hardcopy of the pseudo code, code and the printout
of the output.
• The code should contain the following header:
/**
* Author: xyz
* Description: What the program is expected to do.
* Additional information about variables, parameters, etc
*/
Problems:
1. Using a loop, write a program that takes 10 integer values from the keyboard and outputs the
minimum value of all the values entered. [10 points]
2. Write a program that takes a value as an input from the keyboard and outputs the factorial of
that number; the factorial of an integer n is n*(n-1)*…*3*2*1. For instance, the factorial of 4
is 4*3*2*1, or 24. [15 points]
3. Modify the program that you wrote for Problem 1 in the Assignment 3. This time, the
program will not read a web address but an e-mail address (for instance,
[email protected])
from the keyboard. The user’s input must contain an @ character. If it does not, then your
program should keep prompting the user for an input. When the user types in a valid e-mail
address containing an @ character, the program should output whether the e-mail address is
for a government agency, a university, a business, an organization, or another entity, as you
did in the previous assignment. [15 points]
4. Write a class encapsulating the concept of a course, assuming a course has the following
attributes: a code (for instance, COP2250), a description, and a number of credits (for
instance, 3). Include a constructor, the accessors and mutators, and methods toString and
equals. Write a client class to test all the methods in your class. [20 points]