Assignment 1
Assignment 1
Write the program and compile the code @ command line to execute
class hello {
public static void main (String[]arg){
System.out.print("Hello, ");
//read your friend name
System.out.print(arg[0]);
System.out.println(“Good Morning!”);
}
}
Find the maximum Compile time and Runtime error messages of simple one line
output message.
Example
Exercise 3: Write a program that takes three inputs and print them in ascending
order and descending order
Exercise 4: Write the program that prints correct output for the formula
F=𝐺 ∗ 𝑀1 ∗ 𝑀2/𝑅2 . Correct the given statement and output the required result.
Exercise 6: Conversation
Write a Java program to create a Conversation between you and your friend
What is your name?
James
Hi James. How do you do?
I'm fine. thanks.
I'm glad to see you James. What type of Programming language do you like?
Java
Write a program that takes a date as input and prints the day of the week that
date falls on. Read the three int input as m(month), d(day) and y(year). Use 1 of
m for January, 2 for February, and so forth. For output print 0 for Sunday, 1 for
Monday and so forth. Use the following formula for the Gregorian calendar.
Exercise 9 : Wind Chill
Given the temperature (in degrees) and the wind speed v(in miles per hour), the
Weather service outputs the temperature(wind chill) as follows. Read
temperature and velocity from user and print the wind chill. Use Math.pow(a,b)
for a^b. The input in invalid if the T value is larger than 50 and v value larger
than 120 or less than 3(Assume the tange of the value fall in that range)
+ 32 . 𝑏 2 . 𝑐)
Your input is a, b, n for X queries . For the given input series, print the
Constraint
0≤X ≤5
0≤a,b,n ≤ 15
Sample Input
2
5345
02310
Sample Output