You are on page 1of 2

Workshop 1

Please do the followings before starting the work:


Create the directory with a name like <class>-<name><roll number>-workshop-01,
e.g.
SE0412-QuangTV00456-workshop01

(1)

In the directory (1), create 2 sub-directories named: QUES1 and QUES2, if the
workshop consists of 2 questions. The solution for each question will be included in
corresponding directory. In each sub-directory you should have all project files to make
sure that your project will be run properly.
Your project just contains the following files: *.java, *.class, run.bat
Submission Requirements:
Compress the folder (1) to .zip (or .rar) file (with the same name) and upload to cms.
Note: If the workshop is one question only then you do not need to create sub-directories.
In general the number of subdirectories is equal to number of questions.

Question 1 (5 marks)
Create a class named Girl which stores information of a girl: name, bust-roundmeasurement, waist-round-measurement, and hip-round-measurement. Then,
implement the following member functions for Girl class:
void accept(): Let users enter information of a girl
void display(): Display all information of a girl. In additon, if a girl who satisfies
the following conditions, vong1>vong2 AND vong3>vong2, then you should
display more information GOOD CURVES otherwise display SO SO.
void set(int, int, int, String): Assign the given data to a girl.

In order to test the above class, you need to implement the main() function which
contains 4 tasks as bellow.

Question 2 (5 marks)
Write a Java program that performs the following operations on an array of integer
number in the main function:
1. Set default value for an array of integer numbers:
2. Display all elements
3. Find the maximum and the minimum values and display those ones
4. Find all the even and positive numbers in the array and display.
Test case:
// 1. values: 6, 8, -10, -2, 7, 11, 14, 5
// 2.
// 3. Max = 14;
Min = -10
// 4. even & postivie: 6, 8, 14

Note:
For input data from keyboard in Java, you can follow steps below:
Step 1: Import class Scanner
import java.util.Scanner;
Step 2: Create an instance of Scanner class
Scanner input = new Scanner(System.in);
Step 3: Depend on type of data, use appropriate method of that instance
For input an integer i:
int i = input.nextInt();
For input a string str:
String str = input.nextLine();
...

You might also like