Reference no: EM131259094
1 a. Create a program named FriendList that declares an array of eight Friend objects and prompts the user to enter data about the friends. Display the Friend objects in alphabetical order by first name. The Friend class includes auto-implemented properties for the Friend's name, phone number, and three integers that together represent the Friend's birthday-month, day, and year.
b. Create a FriendBirthday program that modifies the FriendList program created in Exercise 9a so that after the list of Friend objects is displayed, the program prompts the user for a specific Friend's name and the program returns the Friend's phone number and birthday. Display an appropriate message if the friend requested by the user is not found.
c. Create a program named AllFriendsInSameMonth that modifies the program in Exercise 9b so that after the requested Friend's birthday is displayed, the program also displays a list of every Friend who has a birthday in the same month.
2. a. Write a program named demojobs for Harold's Home Services. The program should instantiate several Job objects and demonstrate their methods. The Job class contains four data fields-description (for example, "wash windows"), time in hours to complete (for example, 3.5), per-hour rate charged (for example, $25.00), and total fee (hourly rate times hours). Include properties to get and set each field except the total fee-that field will be read-only, and its value is calculated each time either the hourly fee or the number of hours is set. Overload the + operator so that two Jobs can be added. The sum of two Jobs is a new Job containing the descriptions of both original Jobs (joined by "and"), the sum of the time in hours for the original Jobs, and the average of the hourly rate for the original Jobs.
b. Harold has realized that his method for computing the fee for combined jobs is not fair. For example, consider the following:
- His fee for painting a house is $100 per hour. If a job takes 10 hours, he earns $1000.
- His fee for dog walking is $10 per hour. If a job takes 1 hour, he earns $10.
- If he combines the two jobs and works a total of 11 hours, he earns only the average rate of $55 per hour, or $605.
Devise an improved, weighted method for calculating Harold's fees for combined Jobs and include it in the overloaded operator+() method. Write a program named DemoJobs2 that demonstrates all the methods in the class work correctly.
3. a. Write a FractionDemo program that instantiates several Fraction objects and demonstrates that their methods work correctly.
Create a Fraction class with fields that hold a whole number, a numerator, and a denominator.
In addition:
- Create properties for each field. The setaccessor for the denominator should not allow a 0 value; the value defaults to 1.
- Add three constructors. One takes three parameters for a whole number, numerator, and denominator. Another accepts two parameters for the numerator and denominator; when this constructor is used, the whole number value is 0. The last constructor is parameterless; it sets the whole number and numerator to 0 and the denominator to 1. (After construction, Fractions do not have to be reduced to proper form. For example, even though 3/9 could be reduced to 1/3, your constructors do not have to perform this task.)
- Add a Reduce() method that reduces a Fraction if it is in improper form. For example, 2/4 should be reduced to 1/2.
- Add an operator+() method that adds two Fractions. To add two fractions, first eliminate any whole number part of the value. For example, 2 1/4 becomes 9/4 and 1 3/5 becomes 8/5. Find a common denominator and convert the fractions to it. For example, when adding 9/4 and 8/5, you can convert them to 45/20 and 32/20. Then you can add the numerators, giving 77/20. Finally, call the Reduce() method to reduce the result, restoring any whole number value so the fractional part of the number is less than 1. For example, 77/20 becomes 3 17/20.
- Include a function that returns a string that contains a Fraction in the usual display format-the whole number, a space, the numerator, a slash (/), and a denominator. When the whole number is 0, just the Fraction part of the value should be displayed (for example, 1/2 instead of 0 1/2). If the numerator is 0, just the whole number should be displayed (for example, 2 instead of 2 0/3).
b. Add an operator*() method to the Fraction class created in Exercise 11a so that it correctly multiplies two Fractions. The result should be in proper, reduced format. Demonstrate that the method works correctly in a program named FractionDemo2.
c. Write a program named FractionDemo3 that includes an array of four Fractions. Prompt the user for values for each. Display every possible combination of addition results and every possible combination of multiplication results for each Fraction pair (that is, each type will have 16 results).
Implementing new target market in connection
: Expansion of Target Market: Implementing new target market in connection with an already existing one will maximize sales immediately. By expanding on the target market we expand on the business as well.
|
Annual rate of return compounded annually
: Assuming a 7.25% annual rate of return compounded annually over a period of ten years, how much principal would a person need to invest in order to achieve a future amount of $12,500?
|
Example of a sequence that gets arbitrarily close
: (a) If possible, write down a convergent sequence that is not bounded. If this is not possible, BRIEFLY explain why (b) Give an example of a sequence that gets arbitrarily close to L=1, but does not converge to L=1.
|
Describe and apply various dimensions of management
: Discuss the roles managers perform, the skills they need to execute those roles effectively, and the way new information technology is affecting these roles and skills. Compare and contrast the principal challenges managers face in today's increas..
|
Write program named demojobs for harolds home services
: Create a program named FriendList that declares an array of eight Friend objects and prompts the user to enter data about the friends. Display the Friend objects in alphabetical order by first name.
|
Find manufacturing lead time for a pari coming off the line
: Suppose the part in previous Problem 2.5 is made in very large quantities on a production line in which an automated work handling system is used to transfer parts between matches.
|
Compute the sample mean standard deviation and median
: Data were collected as part of a study or coffee consumption among graduate students. The following reflect cups per day consumed: Use the Data Analysis Tool to compute the sample mean, standard deviation, and median.
|
What is this gift worth at the present time
: Your rich aunt gives you a high school graduation present of $110,000. Her present is in the form of a 7-year bond with an annual interest rate of 8.4%. The bond says that it will be worth $110,000 in 7 years.
|
Determining the area of a triangle
: The base of a triangle is 4 inches longer than the height. If its area is 70 square inches, then what are the base and the height?
|