College of Computing and Informatics
Assignment 1
Deadline: Tuesday 20/09/2022 @ 23:59
[Total Mark for this Assignment is 8]
Student Details:
Name: ###
ID: ###
CRN: ###
Instructions:
• You must submit two separate copies (one Word file and one PDF file) using the Assignment Template on
Blackboard via the allocated folder. These files must not be in compressed format.
• It is your responsibility to check and make sure that you have uploaded both the correct files.
• Zero mark will be given if you try to bypass the SafeAssign (e.g. misspell words, remove spaces between
words, hide characters, use different character sets, convert text into image or languages other than English
or any kind of manipulation).
• Email submission will not be accepted.
• You are advised to make your work clear and well-presented. This includes filling your information on the cover
page.
• You must use this template, failing which will result in zero mark.
• You MUST show all your work, and text must not be converted into an image, unless specified otherwise by
the question.
• Late submission will result in ZERO mark.
• The work should be your own, copying from students or other resources will result in ZERO mark.
• Use Times New Roman font for all your answers.
Question One
Pg. 01
Learning
Outcome(s):
Question One
Explain the basic
Write a complete Java program that performs the following tasks:
2 Marks
principles of
programming,
1. Print your full name with double quotes.
concept of
language, and
universal
constructs of
programming
languages.
2. Print your home address in 3 lines but using a single print method. The first
line of output is your home number or building number, the second line of
output is your street, and the third line of output is your district.
3. Print the Boolean value for the mathematical expression 100 < 200.
4. Print your first name in lower case and your last name in upper case using %s
format string in a single line.
Note:
•
The class name of your Java program must be your first name.
•
Your answer should have the code as text as well as the screenshot of the
program output (using your own name and your home address) as a part of
your answer. Otherwise, zero marks will be awarded.
Typical run of the program
Question Two
Pg. 02
Learning
Outcome(s):
Explain the basic
principles of
programming,
concept of
Question Two
3 Marks
Write a complete Java program that performs Currency Exchange operation between
Saudi Riyals (R) and Euro (€). Your program must do the following:
1. Ask the user to enter his/her full name.
2. Print a welcome message using the user’s name.
language, and
3. Ask the user to enter the amount in Riyal, convert it to Euro and print the result.
universal
4. Ask the user to enter the amount in Euro, convert it to Riyal and print the result.
constructs of
programming
languages.
Note:
•
Currency change rate is assumed to be known in your program (e.g., 1 Riyal
= 0.2621 Euro).
•
The class name of your Java program must be your first name.
•
Your answer should have the code as text as well as the screenshot of the
program output (using your own name) as a part of your answer. Otherwise,
zero marks will be awarded.
Typical run of the program
Question Three
Pg. 03
Learning
Outcome(s):
Question Three
3 Marks
Write a complete Java program that performs the following tasks:
Explain the basic
principles of
programming,
concept of
language, and
1. Ask the user to enter the last two digits of his/her student ID.
2. Break the number into two digits using arithmetic operators, then store the first and
second digits in integer variables named digit1 and digit2
3. Find and print the following:
universal
constructs of
programming
languages.
•
The product of digit1 and digit2.
•
The sum of digit1 and digit2
•
The average of digit1 and digit2
•
The maximum of the two numbers; digit1 digit2 using a method from the
class Math.
Note:
•
The class name of your Java program must be your first name.
•
Your answer should have the code as text as well as the screenshot of the
program output (using your own student ID) as a part of your answer.
Otherwise, zero marks will be awarded.
Typical run of the program