ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 26 May 2017 My Price 8.00

Create a method named getOperands

1. Create a method named getOperands.  This method does not return a value.  In this 
method, prompt the user twice.  At the first prompt, ask them to enter a double 
variable.  Name it operand1.  At the second prompt, ask them to enter another double 
variable.  Name it operand2.  Use suitable data validation to ensure the variables 
receive a double value.  Another data validation is that operand1 and operand 2 use a 
positive value of at least 2.00 and less than 40.00.  Another data validation is that 
operand1 is less than or equal to the value in operand2.  Keep prompting the user, if 
necessary, until all data validations are passed. 

2.  Now that data validations have been enforced, from getOperands, pass both double 
variables to a method named calcPercentage.  This method does not return a value.  It 
should display the first received value (i.e. operand1's value) as a percentage of the 
second received value (i.e. operand2's value).  For example, if the method receives 
numbers of 2.0 and 5.0, the method should output the following to the command line: 
"The value of 2.0 is X percent of 5.0." where X is the percentage. 

3.  Use method overloading by creating three methods, each named buildName.  The first 
version of buildName should accept two String values named nameFirst and nameLast.  
These are assigned by you in the main method; no user input is needed.  The method 
should return a String of the name parts in reverse order, separated by a comma and 
space.  For example, if the first version of buildName receives "Santa" and "Claus", 
it should return the following value:
"The full name reversed is:  Claus, Santa" 

4.  The second version of buildName should accept a String value named nameFirst, a 
character value named nameMI, and a String value named nameLast.  These are assigned 
by you in the main method; no user input is needed.  The method should return a String 
of the name parts in reverse order, separated by a comma and space.  Append a period 
for the middle initial.  For example, if the second version of buildName receives 
"Santa", "Q", and "Claus", it should return the following value:
"The full name reversed is:  Claus, Santa Q." 

5.  The third version of buildName should accept a String value named nameFirst, a 
character value named nameMI, a String value named nameLast, and an integer 
representing an age.  These are assigned by you in the main method; no user input is 
needed.  The method should return a String of the name and age parts in reverse order, 
separated by a comma and space.  Append a period for the middle initial and include 
the age.  For example, if the third version of buildName receives "Santa", "Q", "Claus", 
and 42, it should return the following value:
"The full name reversed and age are:  Claus, Santa Q. (42 years old)" 

6.  Call each of the methods above from the main method.  The pseudocode 
for the main method will be as given below. 

    Get the operands and ensure data validations are passed
    Calculate the percentage of the operands
    Output the reversed full name and age, depending on the values being provided

Answers

(11)
Status NEW Posted 26 May 2017 02:05 AM My Price 8.00

-----------

Attachments

file 1495765185-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)