Our Services

Get 15% Discount on your First Order

[rank_math_breadcrumb]

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 t

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

In this journal, you will embark on a journey of exploration into emerging technologies that intrigue you; be it virtual reality, wearables, IoT, or any other fascinating field. You will research a ch

In this journal, you will embark on a journey of exploration into emerging technologies that intrigue you; be it virtual reality, wearables, IoT, or any other fascinating field. You will research a chosen technology and reflect on your learning journey, sharing insights gained, challenges faced, and areas primed for growth.

Database Detective This assignment measures your mastery of ULOs 3.4, 4.1, and 4.2. Before working on this assignment, you will need to complete the Unit VI Activity: Access 2021 – Chapter 2 – Wor

Database Detective  This assignment measures your mastery of ULOs 3.4, 4.1, and 4.2. Before working on this assignment, you will need to complete the Unit VI Activity: Access 2021 – Chapter 2 – Working with Tables in the SIMNet lab.  Download and complete the Unit VI Assignment Poole’s Nursery Template. Complete

This PowerPoint Presentation will measure your understanding of the concepts covered in this course to this point. For this assignment, you are going to create a PowerPoint presentation that would

This PowerPoint Presentation will measure your understanding of the concepts covered in this course to this point. For this assignment, you are going to create a PowerPoint presentation that would be appropriate to present to a class of high schoolers. Imagine that you are presenting a proposal to a congressional

This assignment will give you an opportunity to learn more about secondary storage technologies, communications, and networks. Before working on this assignment, you will need to complete the Unit IV

This assignment will give you an opportunity to learn more about secondary storage technologies, communications, and networks. Before working on this assignment, you will need to complete the Unit IV Knowledge Check. Reflect on what you have learned about secondary storage, communications, and network security in this unit. Address the

In Units V, VI, and VII, you learned about the components of a computer, how a computer works, the internet, networks and network communications, cloud computing, web development, digital identity, so

In Units V, VI, and VII, you learned about the components of a computer, how a computer works, the internet, networks and network communications, cloud computing, web development, digital identity, social media, e-commerce, ethical behavior, databases, and explored two Microsoft Office applications, PowerPoint and Access.  In this assignment, you will

Your assignment will have four parts. Before working on this assignment, you will need to complete the Unit III Activity: Word Advanced Features. Part 1: Introduction Begin your assignment with

Your assignment will have four parts. Before working on this assignment, you will need to complete the Unit III Activity: Word Advanced Features. Part 1: Introduction Begin your assignment with an introduction that identifies what a computer, storage, and networking are. Introduce internal, input, and output devices of a computer.

In Units V, VI, and VII, you learned about the components of a computer, how a computer works, the internet, networks and network communications, cloud computing, web development, digital identity, so

In Units V, VI, and VII, you learned about the components of a computer, how a computer works, the internet, networks and network communications, cloud computing, web development, digital identity, social media, e-commerce, ethical behavior, databases, and explored two Microsoft Office applications, PowerPoint and Access.  In this assignment, you will

In Units I, II, and III, you learned about the history of computers, application and system software, blockchain, cryptocurrency, computer ethics, and explored two Microsoft Office applications, Word

In Units I, II, and III, you learned about the history of computers, application and system software, blockchain, cryptocurrency, computer ethics, and explored two Microsoft Office applications, Word and Excel.  In this assignment you will demonstrate what you have learned in these three units. This assignment will have five parts. 

Assignment Tasks Part 1  Choose an organization or company of your choice.  Provide a clear description of the organization, including: o Mission o Vision o Objectives  Identify and describe the ma

Assignment Tasks Part 1  Choose an organization or company of your choice.  Provide a clear description of the organization, including: o Mission o Vision o Objectives  Identify and describe the main business processes in this organization.  Looking at the business processes, point out an issue that

Write 200-250 words on the following topic. Be sure to cite the readings and lectures. Topic: Select two international organizations and explain what role they play in promoting, monitoring, investig

Write 200-250 words on the following topic. Be sure to cite the readings and lectures.  Topic: Select two international organizations and explain what role they play in promoting, monitoring, investigating, and/or enforcing human rights. Use at least one concrete example of a human rights issue (e.g. allegations of war crimes

DFA Closure: 1.4 c and f. Do union and intersection for each (use cross product algorithm) Each of the following languages is the intersection of two simpler languages. In each part, construct DFAs fo

DFA Closure: 1.4 c and f. Do union and intersection for each (use cross product algorithm) Each of the following languages is the intersection of two simpler languages. In each part, construct DFAs for the simpler languages, then combine them using the construction discussed in footnote 3 (page 46) to

DFA Closure: 1.4 c and f. Do union and intersection for each (use cross product algorithm) Each of the following languages is the intersection of two simpler languages. In each part, construct DFAs fo

DFA Closure: 1.4 c and f. Do union and intersection for each (use cross product algorithm) Each of the following languages is the intersection of two simpler languages. In each part, construct DFAs for the simpler languages, then combine them using the construction discussed in footnote 3 (page 46) to

1.2 Lab – More Charts in Excel Submission: Completed Excel workbook via Canvas. Part 1 – Multiple Variable Charts Overview • This problem furthers the ideas from the notes ‘1.2 – Basic Charts in Excel

1.2 Lab – More Charts in ExcelSubmission: Completed Excel workbook via Canvas.Part 1 – Multiple Variable ChartsOverview• This problem furthers the ideas from the notes ‘1.2 – Basic Charts in Excel’, where we learnedhow to create and format many simple charts in Excel.• The first tab of the accompanying workbook