Description
SEE
Assignment #1
Deadline: Monday 29/09/2025 @ 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.
Restricted – مقيد
Question One
Pg. 01
Learning
Outcome(s):
Question One
Explain the basic
In Java programming, there are three main categories of errors that programmers
commonly face.
principles of
programming,
concept of
language, and
universal
constructs of
programming
languages
Restricted – مقيد
1. Identify and briefly describe each category.
2. Provide one example (code snippet or scenario) for each.
3. Explain how a programmer can detect and correct these errors.
2 Marks
Question Two
Pg. 02
Learning
Outcome(s):
Explain the basic
principles of
programming,
concept of
language, and
universal
constructs of
programming
languages
Restricted – مقيد
Question Two
2 Marks
Write a program that asks the user for their weight (double) and height (double), then
calculates and prints their Body Mass Index(BMI).
BMI = weight / (height * height)
Question Three
Pg. 03
Learning
Outcome(s):
Develop a
program based on
specification
using
programming
language
elements
including syntax,
data types,
conditional
statement, control
structures,
procedures,
arrays, objects
and classes.
Restricted – مقيد
Question Three
2 Marks
Write a Java program that declares and initializes variables of all the primitive types:
•
int, double, char, and Boolean.
The program should:
1. Print the variables’ values on the screen.
2. Add the keyword final to the int variable and try to reassign it (observe the
error).
3. Reassign new values to the remaining variables (double, char, and Boolean) and
print the results again.
Question Four
Pg. 04
Learning
Outcome(s):
Develop a
program based on
specification
using
Question Four
Write a Java program that asks the user to enter a number.
If the number is positive, print:
“The number is positive.”
If the number is negative, print:
“The number is negative.”
programming
If the number is zero, print:
“The number is zero.”
language
Sample Output:
elements
including syntax,
data types,
OR:
conditional
statement, control
structures,
procedures,
arrays, objects
and classes.
Restricted – مقيد
OR:
2 Marks
Purchase answer to see full
attachment