Calculate the slope and length of sides

Assignment Help Computer Engineering
Reference no: EM131397268

ASSIGNMENT - DESCRIPTION

This lab is based on the material studied in the first three weeks of the course, including exercises done in the class.

This assignment is to be done individually; you are not allowed to work on this assignment with anyone.

You are to write a program that calculates the slope and length of sides and the perimeter of a rectangle given four of its vertices as ordered pairs (x,y).

A vertex is a point which consists of an x-value and a y-value, and you have four points as the vertices of a rectangle, so you'll need to prompt the user to enter the x-value and y-value for the four vertices of the triangle. You'll need to store these input values inside variables that are declared with appropriate names and data types. Your prompts to the user should be clear, concise, and use proper spelling/grammar.

An example of user interaction should be similar to this (note that values in green are the keystrokes typed by the user):

Recording Vertex A: Enter X-Value: 5.5
Enter Y-Value: 1.0 Recording Vertex B: Enter X-Value: 10.5
Enter Y-Value: 1.0 Recording Vertex C: Enter X-Value: 5.5
Enter Y-Value: 7.5 Recording Vertex D: Enter X-Value: 10.0
Enter Y-Value: 7.5

Your program should display the vertices of the rectangle before it calculates its area. See the proper formatting below.

Sample program output (sample values used here, you may use different values if you wish; you can use these values shown below to test your program).

Vertex A: (5.5, 1.0)
Vertex B: (10.5, 1.0)
Vertex C: (10.5, 7.5)
Vertex D: (5.5, 7.5)

The length of rectangle sides AB, BC, CD, and DA are: 5, 6.5, 5 and 6.5 units and perimeter and area of the rectangle are:

23.00, 32.50 units respectively.

Your user prompts and output must appear exactly as shown above. Vertices must be formatted with one decimal digit and other calculations should be formatted with exactly two digits after the decimal.

Your program must use variables of the appropriate type and with self-documenting names.

You must include appropriate documentation in your code.

Useful Formula

The length of side AB with points A(x1, y1) and B(x2, y2) as its vertices is given by:

AB = √(x2 - x1)2 + (y2-y1)2

Reference no: EM131397268

Questions Cloud

Entrepreneurship and small management : Examine different types of entrepreneurial ventures and explain how they relate to the typology of entrepreneurship
The work experience in tesco singapore pte : This assignment covers all the experience that the learner had during the work experience in Tesco Singapore PTE. The learner elaborates all the events from the job interview to selection, recruitment and other entries.
What is difference between an opportunity cost and sunk cost : What is the difference between an opportunity cost and a sunk cost? Share an example of each with the group. Define variable, fixed, and mixed costs. Share an example of each with the group.
End-of-year grade-level assessments : The odds are high (actually, it's almost guaranteed) that you will have students in your class who are not yet ready to perform at the level required by more rigorous standards and expectations. How will you guide these students in their learning ..
Calculate the slope and length of sides : Write a program that calculates the slope and length of sides and the perimeter of a rectangle given four of its vertices as ordered pairs (x,y).
Explain to upper management chosen multivariate technique : A high-end market research firm has contacted your boss and is trying to sell some business to your organization. Upper management does not want to appear incompetent, so they have asked you to research and explain three major ways multivariate st..
Explain the companys decision to distribute a dividend : ACC/290- Briefly address whether the company's first month of operations was a success. Discuss the company's decision to distribute a dividend.
Create a spreadsheet listing at least five steganography : Do an Internet search to find current steganography tools. Create a spreadsheet listing at least five steganography tools and their features.
Engineering ceramic material failure from life : 1. Identify an engineering CERAMIC material failure from your life. Failure must happen frequently in daily life of everyone.

Reviews

len1397268

2/17/2017 3:00:55 AM

You must submit only the source code file (.java) for your program. DO NOT submit anything else or you will lose marks. DO NOT submit .class files, DO NOT submit your editor's backup files (e.g. .java~ or .bak), etc. The name of this file should be FirstNameLastName_Assign1.java where FirstNameLastName refers to your first and last name. Submit your assignment through SLATE.

len1397268

2/17/2017 3:00:47 AM

Criteria Functionality: Program functions as specified: Program calculates and displays the information specified; output appears exactly as stated in the requirements. Code Efficiency: Program logic is written concisely and is not cluttered with unnecessary tasks or statements; calculations are correct and efficient. Appropriate variable names used and proper data types used. Uses concepts and techniques discussed in class. Programming Style: Code uses proper indentation and spacing. Use of header and inline comments. Adherence to programming standards. Miscellaneous: All other instructions were followed, including submission instructions above. Late Penalty: -10% per day, up to 3 days

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd