0% found this document useful (0 votes)
73 views2 pages

LAB211 Assignment: Title Background Program Specifications

The document outlines a program assignment to design a menu-driven program that allows users to input coefficients for a superlative or quadratic equation, calculates the solutions, and identifies any even, odd, or square numbers among the coefficients and solutions. The program must include functions to calculate the solutions for each equation type and return lists of the solutions along with identifying qualifying numbers. Guidelines provide recommendations on implementing the required functions to solve the equations and check number types.

Uploaded by

Quân Huy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views2 pages

LAB211 Assignment: Title Background Program Specifications

The document outlines a program assignment to design a menu-driven program that allows users to input coefficients for a superlative or quadratic equation, calculates the solutions, and identifies any even, odd, or square numbers among the coefficients and solutions. The program must include functions to calculate the solutions for each equation type and return lists of the solutions along with identifying qualifying numbers. Guidelines provide recommendations on implementing the required functions to solve the equations and check number types.

Uploaded by

Quân Huy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Type: Short Assignment

LAB211 Assignment Code:


LOC:
614870459.docx
72
Slot(s): 1

Title
Solving the equation, find the square numbers, even numbers, and odd numbers.
Background
N/A
Program Specifications
Design a program that lets users input coefficients of superlative and quadratic equations. Display the odd, even
and square numbers from input coefficients.
Function details:

Function 1: Display a menu and ask users to select an option.

 Users run the program. The program prompts users to select an option.
 Users select an option, perform Function 2.

Function 2: Perform function based on the selected option..

 Option 1: Calculate Superlative Equation


o The require user to input coefficients A, B
o Validate inputted values (A, B must be valid numbers)
o Calculate the solution x and display it on the screen
o Find and display even, odd and square numbers from inputted coefficients
o Return to the main screen
 Option 2: Calculate Quadratic Equation
o The require user to input coefficients A, B, C
o Validate inputted values (A, B, C must be valid numbers)
o Calculate the solution x1, x2 and display them on the screen
o Find and display even, odd and square numbers from inputted coefficients
o Return to the main screen. 1
 Option 3: Exit the program

Expectation of User interface:


1 2
========= Equation Program ========= ----- Calculate Equation -----
1. Calculate Superlative Equation Enter A: a
2. Calculate Quadratic Equation Please input number
3. Exit Enter A: 4
Please choice one option: Enter B: 5
Solution: x = -1.250
Number is Odd:5.0, -1.25
Number is Even:4.0
3 Number is Perfect Square:4.0
----- Calculate Quadratic Equation -----
Enter A: a
Please input number
Enter A: 4
Enter B: 4
Enter C: 1
Solution: x1 = -0.500 and x2 = -0.500
Odd Number(s):1.0, -0.5, -0.5
Number is Even:4.0, 4.0
Number is Perfect Square:4.0, 4.0, 1.0

Guidelines
Student must implement the following methods:
calculateEquation
calculateQuadraticEquation

in startup code.
Recommend:
Find the square number by using Math.sqrt to root 2, find odd as a% 2! = 0.
Use public Float checkin (String floatString) in class Number to check if a, b, c enter numerical values Is yet.Use public
boolean isOdd (float number) function to check odd number or not
Use ham isPerfectSquare public boolean (float number) to check the number is a local number or not.
Function 1: Solving superlative equation
o Must write the function: public List <Float> calculateEquation (float a, float b)

 Input:

 a: a value
 b: b value
o Return: list (no solution = null, infinitely many solutions = empty). Function 2: Solving quadratic. Must write the
function: public List<Float> calculateQuadraticEquation(float a, float b, float c)

 Input: a - the value of a; b: the value of b; c: the value of c.

 Return Value: list (where no solution = null, infinitely many solutions = empty).

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy