You are on page 1of 2

CS 4 – 1ST QTR

FORMATIVE ASSESSMENT#2 – BASIC I/O


Choose only one (1) among the list of problems below.
Program Specifications:
1. File Name: Ex<Problem#>_Section_LastNameFirstName.java
Example, I chose problem #3, Ex3_Gluon_PelayreAnneFatima.java
2. At the topmost part of your program put the following comments:
/* Name: <Last Name, First Name Middle Initial>
Section: <Your Section>
Date Started: <mm/dd/yyyy>
Date Finished: <mm/dd/yyyy>
*/
3. Submit the .java file.
PROBLEMS:
1.  Write a program that will accept a 5 - digit integer number and displays each digit in reverse order.
Sample Output:
Input: 12345
Output: The reverse of 12345 is 5 4 3 2 1
2. Write a program that reads an integer between 0 and 1234 and adds all the digits in an integer. For example, if
an integer is 1234, the sum of its digits is 10.
3. Write a program that asks the user to enter a favorite color, a favorite food, a favorite  animal (favorites may
depend on your preference of favorite), and the first name of a friend or relative (or an idol). The program should
then print the following two lines, with the user's input replacing the items in bold italics:
I had a dream that Name ate a Color Animal and said it tasted like Food!
For example, the user entered blue for the color, adobo for the food, rabbit for animal, and Daenerys for the
person's name, the output would be:
I had a dream that Daenerys ate a blue rabbit and said it tasted like adobo!

RUBRICS:
CRITERIA (3)  (2) (1) POOR (0)
1. Naming All user defined Some of the user Variable names are cryptic. Variable names are
Identifiers identifiers are defined identifiers are inappropriate.
(File name and meaningful. meaningful.
variables)
2. Data Type Data are represented Some of the data are One data is well Wrong
well. well represented. represented. identification of the
data type.
3. User All of the prompts areSome of the prompts Prompts are understandable Prompts are
Prompts meaningful and can be are meaningful and by the programmer’s level inappropriate.
easily understood by can be easily only.
any user. understood by any
user.
4. User Input Correctly takes user User input is handled User input is handled but No handling of user
input. but with minor error. with major error. input
5. Process Process is correct.     Wrong process.
6. Result The program displays The program displays The program displays a The program does
the correct result. a result but with minor wrong result. not display a result.
error.
7. Program The program contains The program has The program executes but Program does not
Execution no logic error. minor errors. has major error(s). execute.
8. Solution The program meets all The program produces The program produces The program is
of the specifications the correct results and correct results but does not producing incorrect
required. meets most of the display them correctly or result.
requirements. does not follow
specifications.
9. Submission Follow the directed     Wrong format.
Format format.
10. Coding All coding standard Some coding standards One coding standard have No coding standard
Standard have been followed. have been followed been followed. have been
followed.

You might also like