Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

-spring2019.pd xhttpshmyasucourses.asu.edu+ u.edu/bbcswebdav/pid-19784487-dt-content-rid-146713815.1/courses/2019Spring-T-CSE110-16223/hws-spring2019.pdt Use the following Guidelines: Give identifiers semantic meaning and make them easy to read (examples numStudents, grossPay, etc). Keep identifiers to a

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
-spring2019.pd xhttpshmyasucourses.asu.edu+ u.edu/bbcswebdav/pid-19784487-dt-content-rid-146713815.1/courses/2019Spring-T-CSE110-16223/hws-spring2019.pdt Use the following Guidelines: Give identifiers semantic meaning and make them easy to read (examples numStudents, grossPay, etc). Keep identifiers to a reasonably short length. case with uppercase word separators for all other identifiers (variables, methods, objects). Use tabs or spaces to indent code within blocks (code surrounded by braces). This includes classes, methods, and code associated with ifs, switches and loops. Be consistent with the number of spaces or tabs that you use to indent. Use white space to make your program more readable Reasonably good amount of comments should be added in your program so that it is easy for other people to understand it. Please see the comment style in the textbook. . Important Note: All submitted assignments must begin with the descriptive comment block. To avoid losing trivial points, make sure this comment header is included in every assignment you submit, and that it is updated accordingly from assignment to assignment. /e9 // Name: your nane // Title: title of the source file II Description: Write, the description in your words. // Time spent: how long it took you to complete the assignment // Date: the date you programmed K https:/myasuceunes.asuedu + asucourses w/pid-19784487-dt-content-rid-14671 Part 1: Written Exercises: (4 pts) Note: The answers to the following two questions should be typed in the block of comments in the AssignemntS jva file. Please make sure is commented out (green). Type them neatly and make them easy to read for the graders that takes a boolean parameter. If the parameter's value is false, the method should return 0; otherwise it should return 1 2 Write a method called meltiCencat that takes a String and an integer as parameters of the string parameter cencatenated with itself the parameter values are "hi and 4, the return value is "hihih". Returm the original is less than 2 Return a String that consists For example, if string if the integer Panater Your assignment is to write a class definition (not a program, there is no main method) named Triangle (saved in a file Triangle java).A Triangle has three instance variables: int side1, side2, side3 Methods escription of the Method ublic Trlangle (int sl, int a2. int s31 up a triangle with the specified side lengths. ublie int getside1 ic int getside2 Returns side 2 ublle int getside3 side 3 Sets side 1 side 2 s side 3 vold setsidelfint Length) public void Returns the length of the longest side of the triangle. This is a helper private int largest F7 D hw5-spring2019 pdf ses.as. d-19784487-dt-content-rid-146713815.1/courses/2019Spring-T-CSE110-16223/hws-spring 2019.pdf public boolean is_ equilateral he shortest side, then the triangle is equilateral. You should accomplishit by calling the private methods. Determines whether a triangle is isosceles. Any (and at least) two sides must be equal pubiie boolean is isosceles 0 publie boolean is scalene () public string toString ) Determines whether a triangle is scalene. No two sides are equal nts the sides of the triangle using the following format: The class Triangle mast include the following constructors and methods: (If your elass does not contain any of the following methods, points will be deducted) Save the Triangle class in a file called Triangle java and use the following program stored in Assignment5.java, which Triangle it is. A sample custput is shown below has the main method to create new Triangle object and to test what kind of class should have exactly the method headers that are described or ocherwise your Important Notes: Your class will sot work with the test driver program (AssignmentS java) that is provided. You should aat changs the test drissr program if the test driver is provided but insicad make changes to Triangle class to malke it work Helpful hints for doing this assignment on in in steps- wnite one method, sest it with a teat driver and make suee it works before going on to the always make sure your code compiles before you add another method methods should be able to be called in any oeder Sample output: aser inapst is in red F2 xD https/myasucourses.asu.edu x + g x hw5-spring2019.pdf yasucourses.asu.edu/bbcswebdav/pid-19784487-dt-content-rid-146713815.1/courses/2019Spring-T-CSE110-16223/hw5-sp Sample output: user input is in red Enter the sides of the triangle: 345 Sides:3 45 It is a right triangle It is not isosceles It is not a equilateral It is scalene Cock another Triangle (y)? y Enter the sides of the triangle: 8513 It is not a valid Triangle Check another Triangle (yn)? y Enter the sides of the triangle: Sides: 444 It is not a right triangle It is isosceles It is equilateral It is not scalene Check another Triangle (yimy Enter the sides of the triangle 445 Sides: 44 5 It is not a right triangle It is isosceles It is not a equilateral It is not scalene Check another Triangle (y)? n -spring2019.pd x D https://myasucourses.asu.edu.x u.edu/bbcswebdav/pid-19784487-dt-content-rid-146713815.1/courses/2019Spring-T-CSE110-16223/hw5-spring20 It is equilateral It is not scalene Check another Triangle (y n)? y Enter the sides of the triangle: 445 Sides: 44 5 It is not a right triangle It is isosceles It is not a equilateral It is not scalene Check another Triangle (y'n)? n Submit your homework by follewing the instructions helen Go to course web site (my.asu.edu), and then click on the Assignment tab. Upload your Assignment5.iava and Triangle.java files on-line using the Assignmnet5 link .Assignment5 java should have the following, in order: o In comments, the answers to questions to part 1 o In comments, the assignment Header described in "Important Note" The working Java code requested in Part #2 Make sure AssignmentS,java and Triangle.java compile and run before uploading your files o Important Note: You may resubmit as many times as you like until the deadline, but we will only mark your last NO LATE ASSIGNMENTS WILL BE ACCEPTED

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