Welcome to Premium Paper Help

premiumpaperhelp.com logo

Our Services

Get 15% Discount on your First Order

Week6_Test Plan Instructions: The Test Plan for each project includes the Pseudocode, Flowchart, Goals and Objectives, Functional Requirements, and Test

Week6_Test Plan

Instructions:

The Test Plan for each project includes the Pseudocode, Flowchart, Goals and Objectives, Functional Requirements, and Test Matrix including Actual Output column.  Below the table are screenshots verifying the actual output for each case.

Week 6 Notes – Methods/Functions

Let us recall our Week 5 Notes:   We were using Loops, which we may use again each week.

For Week 5, we have all 4 usual tasks, including our Week 5 Projects 1 & 6 from the text.

For Week 6, we again have 4 graded items due this week:

(1) Week 6 Discussion, (2) Week 6 Projects 4 & 5 and quizzes from text, (3) Test Plan for each project

Our Test Plan has 5 parts, in order:  (1) Pseudocode, (2) Flowchart, (3) Goals & Objectives, (4) Functional Requirements, the (5) Test Matrix/table (simplified), and Output (screenshots, under your table, verifying  your Actual Result).   Please make it clear that all 5 tasks are covered for each of your projects.

Our Tasks this Week

You may have worked with functions before.  We call these “methods” in Java. 

Discussion:  We show examples of methods.

Quizzes:  As usual, just let me know if you seem to have questionable grading, for your quizzes or for your projects.

Test Plan:   Refers to Projects 4 and 5 in Chapter 6.  See above for details for 5 tasks.

Project 4 (Exercise 06_25)

Given user input of milliseconds, output the hours: minutes: seconds equivalent.  Create the method, called by main, to calculate this.   See instructions.

Sample run: 

Enter time in milliseconds: 555550000154:19:10

We may complete the method with something like this:

    // Compute the current minute in the hour

    int minutes = (int)(totalMinutes % 60);

    // Computer the current hours here

    return hours + “:” + minutes + “:” + seconds; // at end of method

Project 5 (Exercise 06_37)

Given user input of an integer and the desired length with leading 0’s, write a method to create the String.   This method is called from main.   See instructions.

Sample run:

Enter an Integer: 34Enter the width: 5The formatted number is 00034

You can imagine using a loop in the method, and the String length function (len) can be useful.  In the sample run above, the length (len) of the integer 34 is 2.  If the integer were 340, the length would be 3, and we would only need to add two leading 0’s for output of width 5  —  00340.

EXAMPLE:   Value-Returning Method

Our textbook prefers the first means of calling the method, which is inside the println statement.

Here is the method, often written below the main method, inside the class:

public static double convertMilesToKilometers(double miles) { // miles is a parameter     return miles * 0.60934;   }

Calling the method: 

Then inside main, we have two ways to call the convertMilesToMiles method (or any nonvoid method):

First,  we can call the method from inside a print or println statement. Preferred by Revel text.

System.out.print(“\n Enter distance in miles: “);double miles = scandouble.nextDouble();System.out.println(” ” + miles + ” miles = ” + convertMilesToKilometers(miles) + ” kilometers”);  

Second way to call the non-void method from inside main:

     double distanceInKilometers = convertMilesToKilometers(miles);  // calls the method

NOTE that when using this way to call the method, we needed to receive the answer returned from that method.   We used Assignment Statement distanceInKilometers = to do that. 

Flowcharting Example for Main and another Method  — see new Announcement.

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

GCU College of Education

GCU College of Education LESSON UNIT PLAN TEMPLATE Section 1: Lesson Preparation Teacher Candidate Name: Briana Jenkins Grade Level: 3rd Unit/Subject: Title of Unit and Brief Summary: Lesson 1: Visualizing Concepts In this lesson, students will explore their preferred learning styles, focusing on visual and auditory preferences. They will engage

All information is in attachments. Please follow closely.  5/20/24, 11:13 AM Page 1 of 3about:srcdoc Culturally Responsive Instruction – Rubric

All information is in attachments. Please follow closely.  5/20/24, 11:13 AM Page 1 of 3about:srcdoc Culturally Responsive Instruction – Rubric Total 255 points Criterion 1. Unsatisfactory 2. Less Than Satisfactory 3. Satisfactory 4. Good 5. Excellent Explanation of How You Will Integrate Culturally Responsive Instruction Into Your Teaching Practice An

Review this week’s Learning Resources to deepen your understanding of the roles and responsibilities of forensic psychology professionals in police and

Review this week’s Learning Resources to deepen your understanding of the roles and responsibilities of forensic psychology professionals in police and investigative psychology settings. Select one subspecialty area from either “police psychology” or “investigative psychology” andthen choose one Learning Resource concerning that subspeciality form this week’s Learning Resources on which to

Description Thank you for your post. One new insight to consider is the role of innovation in driving collaboration between payors and healthcare

Description Thank you for your post. One new insight to consider is the role of innovation in driving collaboration between payors and healthcare systems. Innovation in healthcare technology, such as artificial intelligence, wearable devices, and telemedicine, has the potential to revolutionize how care is delivered, monitored, and reimbursed (Kumar et

Create a Microsoft PowerPoint presentation, featuring your own example of replacement analysis (Chapter 11). Your example must include specific numbers and

Create a Microsoft PowerPoint presentation, featuring your own example of replacement analysis (Chapter 11). Your example must include specific numbers and calculations. Essential Activities: Reading Chapter 11, sections 1-3 in Blank & Tarquin will assist you in preparing your presentation. Reviewing slides for Chapter 11 will assist you in preparing