Answers
While solving the question, i have written the whole pseudocode along the some explanation of the code in comment fashion to help you understand the program. Consider the output written in the rectangular box as on a single line separated by single space.
sel Class Coordinate Il Declaring a clan named l coordinate Private Real se ll Declaring two real number Private Real y ll variables x and y Public Module set x (Real value) - Set x = value End module Il Malule (or function) to ser the value of x Public Module set_y (Real value) value End modue // function to set the value - 4 of ay Public Function get-x(2 - Returen - x End module // function to get the value - Hof - - Public function get y . Retuten And madue Il furiction to get the value- ll of y Public Module add (coordinate c) . Set x = -x + c.get_x() - set y = - 4 + c. get-y i End Module Il function to add two I coordinate End Class
Module main () // calling main Module Declare coordinate c1 = New coordinate I creating new reject a of the given 1 clan coordinate So clare coordinate c2= New Coordinate () I creating one more object c2 of the 11 given class coordinate call closet_x (1.0) 01.
.
0 . x1.07 c1 call cl. set. -y 120 c2 Call (2. set-x (3.0) Tx13.07 .
Call_c2. sef-461.0_ _ 44:01 Display cliget-X(), CI getsychic2.get=x),c2.gety) A output. 1.0 2.0 4.0 3.0 ch I Call cladd(C2)_ 20+40760 alis play_cl. get-x(), c).get-yy, c2.get=x0,c2.get-yl)-- Hout put: 4.0 output will be 6.0 3.0 4.0 1.0 2.0 3.0 4.0 4.0 6.0 3.0 4.0
Similar Solved Questions
1 answer
II: ketone III: carboxylic acid IV: 2° alcohol V: cyclic ester II: carboxylate III: aldehyde IV:...
II: ketone III: carboxylic acid IV: 2° alcohol V: cyclic ester II: carboxylate III: aldehyde IV: epoxide V: ketone II: ketone III: carboxylic acid IV: 3° alcohol V: cyclic ester II: ether III: ketone IV: 3° alcohol V. ketone II: ketone III: carboxylic acid IV: Valcohol V/ cyclic ester 2....
1 answer
A solution is made by dissolving 41.1 g urea (CH N20), a nonelectrolyte, in 275 g...
A solution is made by dissolving 41.1 g urea (CH N20), a nonelectrolyte, in 275 g water. Calculate the vapor pressure of this solution at 25°C and 45°C. 25°C 45°C vapor pressure of water 23.8 torr 71.9 torr vapor pressure at 25°C vapor pressure at 45°C -...
1 answer
Determine the future value of $28,000 under each of the following sets of assumptions (FV of...
Determine the future value of $28,000 under each of the following sets of assumptions (FV of $1, PV of $1, FVA of $1, PVA of $1, FVAD of $1 and PVAD of $1) (Use appropriate factor(s) from the tables provided. Round your final answers to nearest whole dollar amount.): Annual Rate Period I...
1 answer
A particular fruit's weights are normally distributed, with a mean of 623 grams and a standard...
A particular fruit's weights are normally distributed, with a mean of 623 grams and a standard deviation of 36 grams. The heaviest 15% of fruits weigh more than how many grams? Give your answer to the nearest gram....
1 answer
Two-point charges q1=+2.35nC and q2=−6.75nC are 0.100 mm apart. Point A is midway between them; point...
Two-point charges q1=+2.35nC and q2=−6.75nC are 0.100 mm apart. Point A is midway between them; point B is 0.080 mm from q1 and 0.060 m from q2. Take the electric potential to be zero at infinity. Find the potential at point A Find the potential at point B. Find the work done by the electric f...
1 answer
[The following information applies to the questions displayed below.] Data for Hermann Corporation are shown below....
[The following information applies to the questions displayed below.] Data for Hermann Corporation are shown below. Percent of Sales 100% Selling price Variable expenses Contribution margin Per Unit $130 78 $ 52 60 40% Fixed expenses are $86,000 per month and the company is selling 2,800 units per m...
1 answer
The wage bracket with holding table is used to: Multiple Choice Prepare the W-4 Compute social...
The wage bracket with holding table is used to: Multiple Choice Prepare the W-4 Compute social security withholding. Compute Medica re withholding. Compute unemployment taxes. Prepare the W-4 Compute social security withholding. Compute Medicare withholding. Compute unemployment taxes Compute federa...
1 answer
To maximize V(F), managers should make the CCC as (_______) as possible. The CCC represents the...
To maximize V(F), managers should make the CCC as (_______) as possible. The CCC represents the time period for (______) period...
1 answer
A 4.03-F and a 5.85-F capacitor are connected in series across a 40.0-V battery. A 6.52-F...
A 4.03-F and a 5.85-F capacitor are connected in series across a 40.0-V battery. A 6.52-F capacitor is then connected in parallel across the 4.03-F capacitor. Determine the voltage across the 6.52-F capacitor....
1 answer
Grouper Construction Company has entered into a contract beginning January 1, 2020, to build a parking...
Grouper Construction Company has entered into a contract beginning January 1, 2020, to build a parking complex. It has been estimated that the complex will cost $606,000 and will take 3 years to construct. The complex will be billed to the purchasing company at $896,000. The following data pertain t...
1 answer
For each of the following questions, provide the missing reagents (that can be purchased) and conditions or predic...
For each of the following questions, provide the missing reagents (that can be purchased) and conditions or predict the MAJOR product. Indicate stereochemistry and identify a racemic mixture if applicable. If no reaction occurs, write out "no reaction." . a. d. Ag,O/NH,OH "ОН...
1 answer
Des x Lv2] Online teaching and les onm /lim/takeAssignment/takeCovalentActivity do?locator-assignment-take&take... e desn Use the References to...
Des x Lv2] Online teaching and les onm /lim/takeAssignment/takeCovalentActivity do?locator-assignment-take&take... e desn Use the References to access important values if needed for this question. Which sample contains the greatest number of atoms. A sample of Cu that contains 2.71x1024 atoms or...
1 answer
Question 4 4 pts Tokiko is 9 months pregnant and her doctor just gave her a...
Question 4 4 pts Tokiko is 9 months pregnant and her doctor just gave her a dose of a synthetic oxytocin. Why would a doctor administer this at the end of her pregnancy? O It will help increase the lung capacity of the baby. Oxytocin will help stimulate contractions and progress labor. This will hel...
2 answers
List the three types of chemical bonds and explain the differences among them?
List the three types of chemical bonds and explain the differences among them?...