0% found this document useful (0 votes)
9 views

Assignment01 Opt1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Assignment01 Opt1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Java Basics

T ra in in g As s ig nmen t

Document Code 25e-BM/HR/HDCV/FSOFT

Version 1.1

Effective Date 20/05/2019

Hanoi, 05/2020
Training Assignments Java Basics (Automation Test) Issue/Revision: x/y

RECORD OF CHANGES

No Effective Date Change Description Reason Reviewer Approver

1 20/May/2020 Createw a new assignment Create new DieuNT1 VinhNV

25e-BM/HR/HDCV/FSOFT v1.1 Internal use 2/6


Training Assignments Java Basics (Automation Test) Issue/Revision: x/y

Contents
Java Introduction ................................................................................................................................................4
Objective .........................................................................................................................................................4
Business needs ..............................................................................................................................................4
Working requirements ....................................................................................................................................4
Product architecture .......................................................................................................................................4
Technologies ..................................................................................................................................................4
Stored Data ....................................................................................................................................................4
Exercise 1: ......................................................................................................................................................5
Exercise 2: ......................................................................................................................................................5
Exercise 3: ......................................................................................................................................................5
Exercise 4: ......................................................................................................................................................5
Exercise 5: ......................................................................................................................................................6

25e-BM/HR/HDCV/FSOFT v1.1 Internal use 3/6


Training Assignments Java Basics (Automation Test) Issue/Revision: x/y

CODE: Assignment01_Opt1
TYPE: Long
LOC: N/A
DURATION: 90 MINUTES

Java Introduction
Objective
- Java Data Types, Java Operators, Java Input and Output, Java Expressions & Blocks.

Business needs
- TBD

Working requirements
- Working environment: Eclipse IDE.
- Delivery: Source code, deployment and testing, reviewing evident packaged in a compress archive.

Product architecture
- N/A

Technologies
The product implements one or more technology:
- Java basics

Stored Data
- N/A

25e-BM/HR/HDCV/FSOFT v1.1 Internal use 4/6


Training Assignments Java Basics (Automation Test) Issue/Revision: x/y

Exercise 1:
Write a Java program to print the sum of two numbers.
Test Data:
74 + 36
Expected Output :
110

Exercise 2:
Write a Java program to print the result of the following operations.
Test Data:
a. -5 + 8 * 6
b. (55+9) % 9
c. 20 + -3*5 / 8
d. 5 + 15 / 3 * 2 - 8 % 3
Expected Output :
43
1
19
13

Exercise 3:
Write a Java program to multiply two binary numbers.
Input Data:
Input the first binary number: 10
Input the second binary number: 11
Expected Output
Product of two binary numbers: 110

Exercise 4:
Write a Java program that accepts two integer values from the user and return the larger values. However if
the two values are the same, return 0 and return the smaller value if the two values have the same remainder
when divided by 6.
Sample Output:
Input the first number : 12
Input the second number: 13
Result: 13

25e-BM/HR/HDCV/FSOFT v1.1 Internal use 5/6


Training Assignments Java Basics (Automation Test) Issue/Revision: x/y

Exercise 5:

Write a Java program to takes the user for a distance (in meters) and the time was taken (as three numbers:
hours, minutes, seconds), and display the speed, in meters per second, kilometers per hour and miles per
hour (hint: 1 mile = 1609 meters).

Test Data
Input distance in meters: 2500
Input hour: 5
Input minutes: 56
Input seconds: 23
Expected Output :
Your speed in meters/second is 0.11691531
Your speed in km/h is 0.42089513
Your speed in miles/h is 0.26158804

-- THE END --

25e-BM/HR/HDCV/FSOFT v1.1 Internal use 6/6

You might also like