Name : Ali Bajundoh
Student ID : 180189140Pg. 03
Question Two
Question One
3 Marks
Learning Outcome(s):
Explain the basic principles of programming, concept of language, and universal constructs of programming languages.
Write a java program that calculates the cost of individual items, including tax, and prints the grocery bill. 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.
3. Ask the user to enter the name of the item.
4. Ask the user to enter the price and quantity of the item.
5. Declare a constant variable that holds a tax rate equal to 15%.
6. Calculate the total price of the item, including the tax.
7. Print the grocery bill.
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) as a part of your answer. Otherwise, zero marks will be awarded.
A typical run of the program
Question Two
3 Marks
Learning Outcome(s):
Explain the basic principles of programming, concept of language, and universal constructs of programming languages.
Write a complete Java program that does the following:
1. Ask the user to enter the last number and the second last number of his / her student ID.
2. Stores the entered numbers in adequate variables.
3. Finds and prints the following using “printf”:
· The sum of the two numbers.
· The boolean value of comparing the equality of the two numbers using the equality operator.
· The value of the first number is raised to the power of the second number 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
.
A typical run of the program
Question Three
2 Marks
Learning Outcome(s):
Explain the basic principles of programming, concept of language, and universal constructs of programming languages.
Write a complete Java program that prints out the following information:
1. Declare a String object and a variable to store your first name and ID.
2. Display your name and student ID in two separate lines using
one println()
statement.
3.
Replace your name with your father’s name using the assignment operator and print the result.
4. Display the course name, course code, and your grade in a tabular format.
(e.g., course name course code grade
computer programing CS140 A ).
Note:
·
The class name of your Java program must be your first name.
·
Your answer should have the
Why Choose Us
- 100% non-plagiarized Papers
- 24/7 /365 Service Available
- Affordable Prices
- Any Paper, Urgency, and Subject
- Will complete your papers in 6 hours
- On-time Delivery
- Money-back and Privacy guarantees
- Unlimited Amendments upon request
- Satisfaction guarantee
How it Works
- Click on the “Place Order” tab at the top menu or “Order Now” icon at the bottom and a new page will appear with an order form to be filled.
- Fill in your paper’s requirements in the "PAPER DETAILS" section.
- Fill in your paper’s academic level, deadline, and the required number of pages from the drop-down menus.
- Click “CREATE ACCOUNT & SIGN IN” to enter your registration details and get an account with us for record-keeping and then, click on “PROCEED TO CHECKOUT” at the bottom of the page.
- From there, the payment sections will show, follow the guided payment process and your order will be available for our writing team to work on it.