Question: IN1105-Introduction to Programming The main objective of this Lab Assignment is to get hands on experience of simple Java programs. This assignment shall help to

IN1105-Introduction to Programming The main objective of this Lab Assignment is to get hands on experience of simple Java programs. This assignment shall help to work with print statement and data types used in Java. Below are few exercise programs related to the topics we have already covered in class lectures. Each program has 2% weightage. Please submit the exercise question statements along with your answers (code for solving this exercise) while submitting your assignment. Please comment your code properly. You also NEED to show output of the program in the assignment by taking a screenshot of your output. Please submit your file in pdf format and the name of the submitted file should be based on your rst name, student id and lab 1 e.g. a student with name Manpreet Singh and student id 201955967 will submit a file with this name Manpreet_201955967_Lab1.pdf Exercise 1: Write a Java program that displays your first name and second name on one line using two print statements. First print statement will print your first name and second print statement will print surname. but the two names must be printed in the output on the same line. Exercise 2: Write a Java program that displays your first name and second name on two lines using a single print statement. First name should be on line 1 and surname should be on line 2. Use print statement only once. Exercise 3: Write a Java program that calculates the area of a triangle. The program must declare three variables, base. perpendicular and area. The base and perpendicular have values 2.5 and 3.0 respectively. Area is l/2*base*perpendicular. The program must print Area at the output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
