Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Upon successful completion of this assignment, the student will have written two Java programs using theconcepts covered in Lesson # 2 . Specifically, the student

Upon successful completion of this assignment, the student will have written two Java programs using theconcepts covered in Lesson #2. Specifically, the student will have demonstrated the concepts of: Observing style guidelines discussed in class (Naming conventions, commenting, indentation, spacing) Declaring and initializing variables and named constants Reading input from the keyboard Performing arithmetic operations Implementing Boolean expressions and conditional statementsCODING EXERCISESImplement the following coding exercises and submit your complete source code along with screenshots of youroutput screens in a Word document. For each coding exercise: Please observe the style guidelines discussed in class such as naming conventions, commenting,indentation, and spacing. Utilize the sample source code that you used in Lab #1 as your guide. Please feel free to use the sample programs provided on the Moodle site that were demonstrated in class tohelp you complete the coding exercises Please include a Welcome message as shown in class that informs the user of your program what theprogram is doing. Please test your programs for a variety of inputs to thoroughly test your code, including both valid andinvalid input Please ensure that all your source code implements the following code as the last statement in your sourcecode which identifies the programmer (with your name) and specifies the semester that the code waswritten for:// Print out final messageSystem.out.println("Written by Warren Edwards, Spring 2024");C2.1 Write simple program that converts kilograms into pounds and stones and ounces and includes input validationas discussed in class: The program should prompt the user to enter a number in kilograms (double), then convert it to pounds(double), and stones (double) and ounces (double) and display the results Please use a named constants for the conversion factor to convert kilograms to pounds and stones and ounces Your program should check for valid and invalid (negative kilogram) inputs and respond appropriately Please test your programs for a variety of inputs to thoroughly test your code, including both valid andinvalid inputINFO 2313 Lab #2 Page 2 of 2C2.2 Write a program that determines the permitter and area of a triangle: The program should prompt the user to enter the length of three edges for a triangle (double) The program should check for valid and invalid input The input is valid if two conditions are both satisfied:1. All the edges have lengths greater than zero2. If the sum of every pair of two edges is greater than the remaining edge (NOTE: there are threechecks to be performed here as there are three unique pairs of edges to check with the remainingedge) If the input is valid (both conditions are satisfied):o Then the program computes the perimeter and area of the triangle and prints out the result If the input is invalid:o Then the program should indicate all the reasons why the input is invalid (there may bemultiple reasons) Please test your programs for a variety of inputs to thoroughly test your code, including both valid andinvalid inputWHAT TO HAND INSubmit a document on the course website with the following: A word-processed cover page, showing your name and student number, the course name, your section(e.g., S12), the lab number and the date of submission, all centered horizontally on the page Your complete source code along with screenshots of your output screens

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions