Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Project Management in Practice

Authors: Samuel J. Mantel Jr., Jack R. Meredith, Sco

4th edition

470533013, 978-0470533017

More Books

Students also viewed these General Management questions