Question: Java only. For each solution of the following problems: Use an appropriate class name (not: Problem1, etc). Use a multiple single line comments at the
Java only.
For each solution of the following problems:
- Use an appropriate class name (not: Problem1, etc).
- Use a multiple single line comments at the top containing the author's name (that's you) and the problem description.
- Use meaningful variable names.
- Use at least one single line comment to explain your code
Problem 1: Write a Java program, that declares three variables day, month and year and initializes those according to today's date. The program will then print out the date in the following format: day/month/year. Find an appropriate name for your program.
Problem 2: Write a program that declares the following: A String variable called myName, an int variable called myAge, a double variable called annualPay. Store your age, name and desired annual income as literals in these variables. The program should display these values on the screen in a sentence similar to the following:
My name is (value of myName), my age is (value of age) and I hope to earn (value of annualPay) per year.
Find an appropriate name for your program.
Problem 3: Write a program called "JavaPrinting" that prints out the following, using escape sequences and only one print statement:
There are two universities in Vancouver: (U should start between "t" and "w"o) UBC (S should start between "t" and "w"o) SFU
I am learning JAVA in this course. My first program was "Hello World!".
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
