Question

GENERAL INSTRUCTIONS              All requirements specified on page 64-67 of the course packet “2.5 Programming Assignment...

GENERAL INSTRUCTIONS

  1.              All requirements specified on page 64-67 of the course packet “2.5 Programming Assignment Submission Requirements” and “2.6 Flow Chart Symbols” should be followed.
  2.              Plan the programs on paper before you attempt to write any programs (it will take less time to complete the assignment overall).
  3.              Electronic version of your programs (the .m files you create) must be uploaded to Canvas. Attach multiple files to one submission. All files must be received by the beginning of class on the announced due date. Plan accordingly. Be sure to use the filename guidelines specified in the assignment guidelines handout.
  4.              Reminder that this is (like all homework assignments) an individual homework assignment. You may discuss general programming methods with each other but your work must be completed independently (see syllabus for academic integrity reminder).

Comments about flowcharts

  • You can use any software to make the flowchart (Word, Excel, Visio, draw.io or others), or you can draw it by hand. If you draw it by hand, you must use a straightedge or template to draw the shapes and lines.
  • This video shows how to make a flowchart with MS Excel 2010 https://www.youtube.com/watch?v=R46sUoojjfM Some things to remember about flow charts:
  • All flowcharts begin and end with a terminator symbol (start/stop or begin/end).
  • The shapes in the flowchart are connected by arrows that show the flow of the program.
  • Flowcharts use specific symbol shapes for input/output and for calculations/processes.

PROGRAM #1

Plan, write and execute a program that will have the user enter the tire pressure for all the tires on their vehicle. Your program will average the tire pressures and output the average pressure. You will need to do some research regarding the units that are typically used for tire pressure and be sure to instruct the user to enter a number with the appropriate units. Use formatted output. Report the average pressure to one decimal place. Have the command prompt show two lines below your output. Your output may look something like this (note: the units shown in the example are nonsense units. You should do some research to know what the correct units should be.)

The average tire pressure is 245.5 bubbles.

>>

PROGRAM #2

Plan and write an Octave program that will have the user enter the coordinates of two points that are on a line. Your program needs to determine the equation of the line. Display for the user the equation of the line in slope-intercept form.

                Your two points (3,15) and (6,-9) form a line.

       The equation of your line is: y = -3.000x + 9.000

The slope and the y-intercept should be displayed in the equation to three decimal places. You can assume that the user will not enter two points that make a vertical line. Your program should handle all other possible lines.

Do your flowcharts…

  1. Use correct symbols?
  2. Have variable names in input/output statements?
  3. Have actual formulas used?

Do your programs have…

  1. Comments throughout?
  2. A heading?
  3. Variable declaration section?
  4. No red-text error messages when they run?

Did you…

  1. Upload your programs/flowcharts to Canvas?
  2. Staple everything in order (flowchart-1, flowchart-2) if done by hand?
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code for question 1:

import java.util.*;

class Main {

public static void main(String[] args)

{

Scanner sc=new Scanner(System.in);

System.out.println("Enter the no. of tyres");

int noOfTyres=sc.nextInt();

double[] pressure=new double[20];

double press=0;

for(int i=0;i<noOfTyres;i++)

{

System.out.println("Enter the pressure of tier "+(i+1)+" in kPa");

pressure[i]=sc.nextDouble();

press=press+pressure[i];

}

double Avgpressure=press/noOfTyres;

System.out.format("The average tyre pressure is %.1f kPa",Avgpressure);

}

}

The code Snippet and output :

Add a comment
Know the answer?
Add Answer to:
GENERAL INSTRUCTIONS              All requirements specified on page 64-67 of the course packet “2.5 Programming Assignment...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Update the program in the bottom using C++ to fit the requirements specified in the assignment....

    Update the program in the bottom using C++ to fit the requirements specified in the assignment. Description For this assignment, you will be writing a single program that enters a loop in which each iteration prompts the user for two, single-line inputs. If the text of either one of the inputs is “quit”, the program should immediately exit. If “quit” is not found, each of these lines of input will be treated as a command line to be executed. These...

  • This is a computer programming assignment to be done in C++ format. This assignment is based on computer language. If y...

    This is a computer programming assignment to be done in C++ format. This assignment is based on computer language. If you upload screenshots i would be thankful. Assignment Write a program that will determine the resultant of three forces. The program must . Prompt for the units Prompt for the magnitude and direction of each force Output the resultant magnitude, direction and correct units. Bonus: the program should ask the user if they want to run the program again. The...

  • employees.txt Instructions You will be using Eclipse for all assignments in this course. You can download...

    employees.txt Instructions You will be using Eclipse for all assignments in this course. You can download Eclipse from the Virtual Desktop. Please write a Java program that follows the instructions below. There are two files to download. AvaCam Inc. is interested in the electronic computation of their payroll. They have reached out, and you have agreed to write a program to help them. They have sent you the file employees.txt (right-click to download the file). Store this file in the...

  • Assignment W3-2 This programming assignment addresses: •Compiling and Executing an App with more than 1 class...

    Assignment W3-2 This programming assignment addresses: •Compiling and Executing an App with more than 1 class •Initializing Objects using Constructors •Software Engineering with Private Instances Variables and Public Set/Get Methods •Uses Methods inside classes Description: You are asked to write a program to process two students’ scores. Each student will have scores for 3 tests, the user will input each student’s full name followed by their three scores. When the data for the two students are read from the keyboard,...

  • C++ Programming Objects Problem Assignment: Programming challenge #1 on page 714: "File Head Program" Write a...

    C++ Programming Objects Problem Assignment: Programming challenge #1 on page 714: "File Head Program" Write a program that asks the user for the name of a file. The program should display the first ten lines of the file on the screen (the “head" of the file). If the file has fewer than ten lines, the entire file should be displayed, with a message indicating the entire file has been displayed. Lab Help: Use the following two files to test your...

  • The program will need to accept two input arguments: the path of the input file and...

    The program will need to accept two input arguments: the path of the input file and the path of the output file. See etc/cpp/example.ifstream.cpp for the basis of how to do this. Once the input and output file paths have been received, the program will need to open the input and output files, read and process each input file line and create a corresponding output file line, close the input and output files, and then create and output some summary...

  • PYTHON PROGRAMMING Instructions: You are responsible for writing a program that allows a user to do...

    PYTHON PROGRAMMING Instructions: You are responsible for writing a program that allows a user to do one of five things at a time: 1. Add students to database. • There should be no duplicate students. If student already exists, do not add the data again; print a message informing student already exists in database. • Enter name, age, and address. 2. Search for students in the database by name. • User enters student name to search • Show student name,...

  • my question is on a java program. i have added all instructions for this homeowrk assignment....

    my question is on a java program. i have added all instructions for this homeowrk assignment. from how the input is entered and what the output should read. im seeing if i can get a psuedo code setup for how the algorithm should be setup. Build an Intersection Check program. User inputs two points as x-y coordinates in twodimension space. Two points represent two end points of a line segment. Then, user can input second two points for the second...

  • I need that in Java CSCI 24000- Fall 2017 Assignment #3-Class-v Players Due: 10/9/2017 This third...

    I need that in Java CSCI 24000- Fall 2017 Assignment #3-Class-v Players Due: 10/9/2017 This third assignment will allow you to explore (by comparing and contrasting through construction and implementation) two different object-oncnted programman罨languages (C++ and Javal You will be creating tme scparate programs-onc written in C++ and on written in Java For this assignment, we are going to explore how we can use objects to build more expressive and cleaner programs. In honor of football season we are going...

  • Create the network specified in the assignment. NOTE: THIS IS NOT A DIAGRAM OF YOUR PERSONAL...

    Create the network specified in the assignment. NOTE: THIS IS NOT A DIAGRAM OF YOUR PERSONAL HOME NETWORK! Start with a house. You'll need to enlarge the house (you will learn how to do this by reading the software's help topics or by experimentation) to be able to put all "inside" devices inside the house graphic. You may substitute a large rectangle to represent the house -- and place all "inside" devices inside the rectangle. This house must be labeled...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT