Create logic for program-continously prompts for numeric

Assignment Help Programming Languages
Reference no: EM1360927

Create the logic for a program that continously prompts the user for two numeric values that represent the sides of a rectangle. Include two oerloaded methods that complete a rectangle's area. One method takes two numeric parameters and calculate the areas by multiplying the parameters. The other takes a single numeric parameters, which is squared to calculate area. Each method dispalys its calculated result. Accept input and respond as follows:

(1). When the user entrers a negative number for the first value, end the program.

(2). If the user enters a negative number for the second value, continue to reprompt the user until the second value is not negative.

(3). If both numbers entered are greater than 0, call the method version that accepts two parameters and pass it both values.

(4). If one of the value entered is 0 but the other is not, call the version of the method that accepts just one parameter and pass it the nonzero value.

(5). If both the eneterd values are 0, display an error message.

Reference no: EM1360927

Questions Cloud

Long term capital for reconstruction of member countries : The World Bank Group was established to help provide long term capital for the reconstruction and development of member countries. Determine which of the following is not one of its financial institutions?
What speed does the arrow leave the bow : An archer puts a 0.34 kg arrow to the bowstring. An average force of 209 N is exerted to draw the string back 1.3 m. Unless otherwise directed, assume that air resistance is negligible. plan energy bar graphs to solve the problem.
Interrelated problems : When identifying a problem, the analysis may discover that the case may have more than one problem. However, problems are usually interrelated. Therefore, articulating the problem statement is a good technique to help scope the problem.
Analyzing case material : Analyzing Case Material - Becoming familiar with the case material is the first major analytical step.
Create logic for program-continously prompts for numeric : Create the logic for a program that continously prompts the user for two numeric values that represent the sides of a rectangle.
Differentiating in a case analysis : determine whether assumptions are useful or faulty, and distinguish between a good and bad information.
Determine the approximate value of a company : Determine the approximate value of a company that earns $5 this year if you wish to earn a 10 percent return and the companys earnings are expected to grow at 5 percent?
Explain how does the us government correct : Devote too few resources to the creation of knowledge. Explain how does the U.S. government correct for this apparent market failure.
Identify a new use for ugc : Choose one of the two publications and identify a new use for UGC. Write a one-page memo to the publisher of that magazine describing your idea and how it would contribute to the goals of the publication.

Reviews

Write a Review

Programming Languages Questions & Answers

  Ruby program that continuously reads in number

Write down Ruby program that continuously reads in number, x, from screen, and then calculates and displays its: factorial, if x is less than 15.

  Prolog program to reads employee-s number

Write a prolog program that reads an employee's number from the keyboard, number of hours worked and an hourly rate of pay.

  Write program where dealer-s five-card hand is dealt

Write a program where the dealer's five-card hand is dealt "face down" so the player cannot see it. The program should then evaluate the dealer's hand.

  Applying constraints in program

You will require to set up constants in program for given: number of square feet per square yard.

  Program for saving account balance report

Savings account balance report from customer savings account file. Every input savings account record contains account number, balance forward, deposits (sum of all deposits).

  Program to compute unit price of items sold

Manager of a Supermarket would like to be able to calculate the unit price of items sold there. To do this the program should input the name and the price of the item.

  Design program to list total points scored for classroom

Student ID, classroom number, and score on the achievement test. Design a program that lists the total points scored for each of the 30 classrooms.

  Formula translation

Write a c code that will evaluate the roots of a quadratic equation

  Write program to accept number from user-fibonacci series

Write a program that accepts a number 'n' from the user and generates Fibonacci series till n (Fibonacci series starts with 0 and 1.

  Create a simple shell

Create a simple shell. Basically your shell should read the line from standard input, parse the line with command and arguments, and operate the command with arguments.

  Create logic for application for user for order information

Create the logic for an application that continuously prompts a user for order information until the user enters "ZZZ" for the customer name or 10 orders.

  Function to retrieve each of the private data members

Write a class called "Date" with month, day and year as private members. Have constructor that sets default date to 1st January 2000. Have accessor function which retrieves each of the private data members.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd