Problem Description

The circuit shown below illustrates some important aspects of the connection between a power company and one of its customers. The customer is represented by three parameters, Vt, P, and pf. Vt is the voltage accessed by plugging into a wall outlet. Customers depend on having a dependable value of Vt in order for their appliances to work properly. Accordingly, the power company regulates the value of Vt carefully. Pdescribes the amount of power used by the customer and is the primary factor in determining the customers electric bill. The power factor, pf, is less familiar. (The power factor is calculated as the cosine of an angle so that its value will always be between zero and one.) In this problem you will be asked to write a Java program to investigate the significance of the power factor. see image.

In the figure, the power lines are represented, somewhat simplistically, as resistances in Ohms. The power company is represented as an AC voltage source. The source voltage, Vs, required to provide the customer with power P at voltage Vt can be determined using the formula see image.

(Vs has units of Vrms.) This formula indicates that the value of Vs depends on the value of Vs.

Write a Java program that prompts the user for a power factor value and then prints a message giving the corresponding value of Vs, using the values for P, R, and Vt shown in the figure above.

Part 1: Problem-Solving Phase

Using the Design Recipe, write each of the following for this problem:

1.Contract
2.Purpose Statement
3.Examples, making sure to include counter-examples
4.Algorithm

Make sure to test your algorithm by hand (see Chapter 2, Section 2.4 in Big Java: Late Objects) with the examples to verify it before continuing to Part 2

Part 2: Implementation Phase

Using Eclipse, write the Java program for the algorithm formulated in Part 1, and test your program with the examples from Part 1. Make sure to incorporate your Contract, Purpose Statement and Examples as one or more comment blocks, and your Algorithm as line comments in your Java source code.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.