0% found this document useful (0 votes)
51 views3 pages

The Result Must Be Formated Like The Given Tesstcase

It provides instructions for 4 programming assignments involving creating projects to perform calculations and string/data manipulations, such as summing integers from input, identifying digit characters, modifying case and contents of strings through various methods, and converting between number/string data types. Students are told to name their folder and
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views3 pages

The Result Must Be Formated Like The Given Tesstcase

It provides instructions for 4 programming assignments involving creating projects to perform calculations and string/data manipulations, such as summing integers from input, identifying digit characters, modifying case and contents of strings through various methods, and converting between number/string data types. Students are told to name their folder and
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Common requirements:

- Create a new folder that is named with the following format: studentID-studentname-
workshopNumber. The folder contains 4 projects: Q1,Q2,Q3,Q4,….
Example: se18123-nguyenvana-WS01 or SE12123-nguyen van a-WS01
- Use jdk 1.8
- The result must be formated like the given tesstcase
- Submit your result to the LMS page( example : se18123-nguyenvana-WS01.zip)

Q1: Create a new project named “Q1”, and then create a class “Tester” in the default package. In the
main method, you are required to enter the list of integers and display the sum of these numbers.
For example:

TC1: TC2:
10 0
50 1
20 2
30 4
40 0
OUTPUT: OUTPUT:
150 7

Q2: Create a new project named “Q2”, and then create a class “Tester” in the default package. In the
main method, you are required to enter the list of chars and display all digit chars
for example:

TC1: TC2:
a a
c c
1 e
2 2
v v
4 OUTPUT:
OUTPUT: 2
124

Q3: Create a new project named “Q3”, and then create a class “Tester” in the default package. In the
main method, you are required to enter a string and do :

- Uppercase the entered string


for example:
INPUT:
humpty dumpty sit on the wall
OUTPUT:
HUMPTY DUMPTY SIT ON THE WALL
- Split the entered string to words
for example:
INPUT:
humpty dumpty sit on the wall
OUTPUT:
humpty
dumpty
sit
on
the
wall
- Remove left, right spaces of the enterd string
for example:
Input:
[ humpty dumpty sit on the wall ]
OUTPUT:
[humpty dumpty sit on the wall]
- Replace all ‘a’ of the entered string to ‘X’
for example:
Input:
humpty dumpty sat on the wall
OUTPUT:
humpty dumpty sXt on the wXll
- Replace a character at index=1 to “MARKER”
for example:
Input:
humpty dumpty sat on the wall
OUTPUT:
hMARKERmpty dumpty sXt on the wXll

Q4: Create a new project named “Q4”, and then create a class “Tester” in the default package. In the
main method, you are required:

-Enter and convert the list of digit characters to a string . For example:
input :
‘2’
‘3’
‘1’

OUTPUT:
[231]
-Enter and conert the list of digit characters to an integer. For example:
input :
‘2’
‘3’
‘1’
OUTPUT:
[231]
-Enter a string and convert to an integer. For example:
input:
190
OUTPUT:
190
-Enter a string and convert to a float. For example:
INPUT:
190.5
OUTPUT:
190.5
-Enter a number and display this number. For example:
INPUT :
15.208
OUTPUT:
15.20

You might also like