Big Java Late Objects
2nd Edition
ISBN: 9781119330455
Author: Horstmann
Publisher: WILEY
expand_more
expand_more
format_list_bulleted
Question
Chapter 2, Problem 12PP
Program Plan Intro
Print source voltage
Program plan:
- Import the required package.
- Create a class “Voltage”,
- Define “main()” function,
- Create an object for “Scanner” class to get the input from the user.
- Initialize the required variables.
- Get the power factor “p_f” from the user using “next()” method.
- Calculate the source voltage using the given formula.
- Print the source voltage as output.
- Define “main()” function,
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
There are 102 towers, including terminal towers, in a transmission line. The spacing (in meters) between all towers is evident. Tension towers and angle towers type towers numbered 8, 15, 20, 28, 37, 46, 58, 65, 74, 87, 93 from the beginning of the line. Write the computer program that will calculate all the ruling openings in this transmission line and draw the flow diagram.
Context: Measuring Air Quality
Levels of various air borne pollutants such as Nitrogen Monoxide (NO), Nitrogen Dioxide (NO2) and particulate matter (also called particle pollution) are all major contributors to the measure of overall air quality.
For instance, NO2 is measured using micrograms in each cubic metre of air (㎍/m3). A microgram (㎍) is one millionth of a gram. A concentration of 1 ㎍/m3 means that one cubic metre of air contains one microgram of pollutant.
To protect our health, the UK Government sets two air quality objectives for NO2 in their Air Quality Strategy
The hourly objective, which is the concentration of NO2 in the air, averaged over a period of one hour.
The annual objective, which is the concentration of NO2 in the air, averaged over a period of a year.
The following table shows the colour encoding and the levels for Objective 1 above, the mean hourly ratio, adopted in the UK.
Index
1
2
3
4
5
6
7
8
9
10
Band
Low
Low
Low
Moderate
Moderate
Moderate
High…
MATLAB CODE
COMPUTER
APPLICATIONS In Electrical Engineering
Chapter 2 Solutions
Big Java Late Objects
Ch. 2.1 - Declare a variable suitable for holding the number...Ch. 2.1 - What is wrong with the following variable...Ch. 2.1 - Declare and initialize two variables, unitPrice...Ch. 2.1 - Prob. 4SCCh. 2.1 - Some drinks are sold in four-packs instead of...Ch. 2.1 - Prob. 6SCCh. 2.1 - Prob. 7SCCh. 2.1 - Prob. 8SCCh. 2.1 - How would you explain assignment using the parking...Ch. 2.2 - A bank account earns interest once per year. In...
Ch. 2.2 - In Java, how do you compute the side length of a...Ch. 2.2 - The volume of a sphere is given by V=43r3 If the...Ch. 2.2 - Prob. 13SCCh. 2.2 - Prob. 14SCCh. 2.3 - Write statements to prompt for and read the users...Ch. 2.3 - What is wrong with the following statement...Ch. 2.3 - Prob. 17SCCh. 2.3 - What is problematic about the following statement...Ch. 2.3 - What is the output of the following statement...Ch. 2.3 - Using the printf method, print the values of the...Ch. 2.4 - Prob. 21SCCh. 2.4 - Suppose the architect specifies a pattern with...Ch. 2.4 - A robot needs to tile a floor with alternating...Ch. 2.4 - For a particular car, repair and maintenance costs...Ch. 2.4 - The shape of a bottle is approximated by two...Ch. 2.5 - What is the length of the string "Java Program"?Ch. 2.5 - Consider this string variable. String str = "Java...Ch. 2.5 - Use string concatenation to turn the string...Ch. 2.5 - Prob. 29SCCh. 2.5 - Prob. 30SCCh. 2 - Write declarations for storing the following...Ch. 2 - What is the value of mystery after this sequence...Ch. 2 - What is wrong with the following sequence of...Ch. 2 - Write the following mathematical expressions in...Ch. 2 - Write the following Java expressions in...Ch. 2 - What are the values of the following expressions?...Ch. 2 - What are the values of the following expressions,...Ch. 2 - What are the values of the following expressions?...Ch. 2 - Assuming that a and b are variables of type int,...Ch. 2 - Suppose direction is an integer angle between 0...Ch. 2 - Find at least five compile-time errors in the...Ch. 2 - Find three run-time errors in the following...Ch. 2 - Consider the following code segment. double...Ch. 2 - Explain the differences between 2, 2.0, 2, 2, and...Ch. 2 - Explain what each of the following program...Ch. 2 - Write pseudocode for a program that reads a word...Ch. 2 - Write pseudocode for a program that reads a name...Ch. 2 - Write pseudocode for a program that computes the...Ch. 2 - Modify the pseudocode for the program in How To...Ch. 2 - Prob. 20RECh. 2 - You are cutting off a piece of pie like this,...Ch. 2 - The following pseudocode describes how to obtain...Ch. 2 - Suppose you are given a string str and two...Ch. 2 - Prob. 24RECh. 2 - For each of the following computations in Java,...Ch. 2 - Prob. 26RECh. 2 - This chapter contains a number of recommendations...Ch. 2 - Write a program that displays the dimensions of a...Ch. 2 - Write a program that computes and displays the...Ch. 2 - Write a program that reads a number and displays...Ch. 2 - Write a program that prompts the user for two...Ch. 2 - Enhance the output of Exercise E2.4 so that the...Ch. 2 - Write a program that prompts the user for a...Ch. 2 - Write a program that prompts the user for a radius...Ch. 2 - Write a program that asks the user for the lengths...Ch. 2 - Improve the program discussed in How To 2.1 to...Ch. 2 - Write a program that helps a person decide whether...Ch. 2 - Write a program that asks the user to input The...Ch. 2 - File names and extensions. Write a program that...Ch. 2 - Write a program that reads a number between 1,000...Ch. 2 - Write a program that reads a number between 1,000...Ch. 2 - Printing a grid. Write a program that prints the...Ch. 2 - Write a program that reads in an integer and...Ch. 2 - Write a program that reads two times in military...Ch. 2 - Writing large letters. A large letter H can be...Ch. 2 - Write a program that transforms numbers 1, 2, 3, ,...Ch. 2 - Write a program that prints a Christmas tree:...Ch. 2 - Easter Sunday is the first Sunday after the first...Ch. 2 - In this project, you will perform calculations...Ch. 2 - The following pseudocode describes how a bookstore...Ch. 2 - The following pseudocode describes how to turn a...Ch. 2 - The following pseudocode describes how to extract...Ch. 2 - Giving change. Implement a program that directs a...Ch. 2 - An online bank wants you to create a program that...Ch. 2 - A video club wants to reward its best members with...Ch. 2 - Consider the following circuit. Write a program...Ch. 2 - The dew point temperature Td can be calculated...Ch. 2 - The pipe clip temperature sensors shown here are...Ch. 2 - Prob. 12PPCh. 2 - Consider the following tuning circuit connected to...Ch. 2 - According to the Coulomb force law, the electric...
Knowledge Booster
Similar questions
- INTRODUCTION: Heat conduction from a cylindrical solid wall of a pipe can be determined by the follow T1-T2 q = 2nLk R2 In R. where: q is the computed heat conduction in Watts. k is the thermal conductivity of the pipe material in Watts/°C/m. L is the length of the pipe in cm. Ri is the inner radius of the pipe in cm. R2 is the outer radius of the pipe in cm. Ti is the internal temperature in °C. T2 is the external temperature in °C. ASSIGNMENT: Write a C program that will allow the user to enter the inner and outer radii of the pipe, the the internal and external temperatures. Once the user enters the input values, the programarrow_forwardytrarrow_forwarddsfrarrow_forward
- A nuclear power station has a safety system based on three inputs to a logic circuit (network). A warning signal (S = 1) is produced when certain conditions in the nuclear power station occur based on these three inputs. CREATE THE LOGIC CIRCUIT SHOWING ALL THE POSSIBLE SITUATIONS. INPUTS BINARY VALUE T P W 1 0 1 0 1 0 DESCRIPTION OF PLANT Temperature > 115°C Temperature 15 bar Reactor pressure 120 litres/hour Cooling water <= 120 litres/hourarrow_forwardA three stage amplifier is to have an overall noise temperature no greater than 7O K. The overall gain of the amplifier is to be at least 45 dB. The amplifier is to be built by adding a low-noise first stage to an existing two-stage amplifier that has the gains and noise figures shown below. The stage number refer to locations in the new amplifier. Stage Power Gain Noise Figure 20 dB 3 dB 13 15 dB 6 dB a. What is the minimum gain in decibels that the first stage can have? b. Using the gain you calculated in part (a), calculate the maximum noise figure in decibels that the first stage can have. Express answer with two decimal places. c. Suppose the gain of the first stage could be increased by 3 dB without affecting its noise figure. What would be the effect on the noise temperature of the complete amplifier?arrow_forward• A circuit consists of a 12 V battery connected across a single resistor. If the current in the circuit is 3 A, calculate the size of the resistor. If a small appliance is rated at a current of 10 amps and a voltage of 120 volts, the power rating would be?.arrow_forward
- Design a traffic light controller for traffic lights. One street is north-south (NS), and another street is east-west (EW). Yellow time is T, green time is 2T, and red time is 3T (T is any time unit, for example, seconds). Light is R on one side when on the other side is G or Y. Lights order is G-Y-R.For the traffic light, as input (Time) use a clock, and the six outputs are G, Y, and R on each side (use color LEDs or show the time diagram). A) State diagram B) True table C) Circuit diagramarrow_forwardGiven the mean time to failure is 1000 hours and the mean ime to repair is 150 hours, compute the software availabilty percentage for this application.arrow_forwardEngineers use both English and SI (Système International d’Unités) units on a regular basis. Some fields use primarily one or the other, but many combine the two systems. For example, the rate of energy input to a steam power plant from burning fossil fuels is usually measured in Btu/hour. However, the electricity produced by the same plant is usually measured in joules/s (watts). Automobile engines, by contrast, are often rated in horsepower or in ft lbf/s. Here are some conversion factors relating these different power measurements: a) Generate a table of conversions from kW to hp. The table should start at 0 kW and end at 15 kW. Use the input function to let the user define the increment between table entries. Use disp and fprintf to create a table with a title, column headings, and appropriate spacing. The output should look like: kW hP 0.0 0.00 2.5 3.35 5.0. 6.70 7.5 10.06 10.0 13.41 12.5…arrow_forward
- Q5: 1800 lb 4 -1200 lb A truss is a structure made of members joined at their ends. For the truss shown in the figure, the forces in the nine members are determined by solv- ing the following system of nine equa- tions: MAX 48 S (2) 6 1 1500 lb F₂+ cos(48.81°)F₁ = 0 42 n 4211 48 ft F6+ cos(48.81°)F₁-F₂ = 0, sin (48.81°)F, +F3 = 0 -cos (48.81°)F₁+F₁ = 0 -sin (48.81°)F₁+F3 = 1800, -F- cos(48.81°)F, = 1200, -F₁-sin (48.81°)F,- sin(45°)F, = 0, sin (45°) F, = 1500, - cos(45°)F,-Fg = 0 Write the equations in matrix form and use MATLAB to determine the forces in the members. A positive force means tensile force and a negative force means compressive force. Display the results in a table where the first column displays the member number and the second column displays the correspond- ing force. The main concept of solving this problem depend on : Element-by-Element Operations The Transpose Operator Using Arrays in MATLAB Built-in Functions Solving Linear Equations All of the givenarrow_forwardThree cables are attached at points A1, A2, and A3, respectively, and are connected at point Ao, to which a given load P is applied as shown. Write a computer program that can be used to determine the tension in each of the cables. y Az(X2. Y2. Z2) A3(Xy, Y3, Z3) A,(Xy. Yy. Z1) A(Xo. Yo, Zo) P Ap(Хр, Ур, Zp)arrow_forwardfull answer, pleasearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Operations Research : Applications and AlgorithmsComputer ScienceISBN:9780534380588Author:Wayne L. WinstonPublisher:Brooks Cole
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole