1. Design a class based on a modified Customer Structure. Use private and public definitions.
2. Create class methods (Setters and Getters) that load the data values. The Setter methods will validate the input data based on the criteria below and load the data into the class if valid.
For character arrays, the data must be within the specified data size. (See #3 below)
For zipCode, the number must be between 0 and 99999.
City and State need to be converted and stored in uppercase.
To get started loading the c-strings.
Getters
The book does not seem to provide a good example of what a (getter) method that returns a char array should look like. Section 9.9 is very close but uses string as examples instead of c-strings.
The best approach is to return a pointer to the c-string- Described as below:
char* getName(); // declaration - also known as prototype
// Customer is my Class name
char* Customer::getName() { // defined member function - Return a pointer to the c-string
return name;
}
cout << YOUR_INSTANCE_HERE.getName() << endl;
Setters
As for creating a setter method - you can define unsized char arrays in the method header
bool Customer::setName(char inputName[]) {
// code here..
}
3. Write a program that will allow me to enter data for the class and create and call a method that displays the data for the class.
During the input process, pass the input data to the setter method and confirm that the data entered is valid based on the class method return value. If not valid,prompt for me to re-enter the data until it does pass the class method's validation.(A do-while loop works well for this situation) I only need to enter the data for 1 instance of the class. The best way to do this is for the setter methods to return bool instead of void. If the data is valid, return true. Otherwise return false.
There is no need to loop for multiple instances of the object. Do not use cin statements inside the class method definitions.
Below is the original structure to use to create your class definition.
const int NAME_SIZE = 20;
const int STREET_SIZE = 30;
const int CITY_SIZE = 20;
const int STATE_CODE_SIZE = 3;
struct Customer {
long customerNumber;
char name[NAME_SIZE];
char streetAddress_1[STREET_SIZE];
char streetAddress_2[STREET_SIZE];
char city[CITY_SIZE];
char state[STATE_CODE_SIZE];
int zipCode;
};
Hints: The const variables need to be defined outside of the class definition.
All access to the data in the class must use public methods that you define. DO NOT DIRECTLY ACCESS the customer data items.
The class level input methods should return a boolean to confirm the data was loaded and passed any size or data ranges. The customerNumber setter does not need to return a value - It can be a void setter.
Set the customerNumber to 1 via the code - not user input. There is no input loop so only 1 set of customer's data is to be entered.
In: Computer Science
1)Draw a chromosome and indicate where urban
centers,deserts,genes,promoters and terminators would be
located.
2)Name the two major molecules that are found in a chromosome
3)Describe how DNA is packed into a chromosome using the following
terms:
a)DNA double helix
b)Histones
c)Nucleosomes
3)Define and contrast chromosomes and gene;
4)State the function of a gene.
5)Describe how Gene's are distributed along a chromosome (urban
centers and deserts), and which base pairs tend to be most
prevalent in coding and non-coding regions.
In: Biology
Question 2: Consider the following activities and their durations and requirements for a construction project.
|
Activity |
Predecessors |
Activity Duration (days) |
||
|
Optimistic |
Most likely |
Pessimistic |
||
|
A |
- |
2 |
7 |
9 |
|
B |
- |
3 |
6 |
9 |
|
C |
- |
3 |
5 |
8 |
|
D |
A |
15 |
19 |
20 |
|
E |
B, C |
6 |
9 |
10 |
|
F |
C |
2 |
4 |
6 |
|
G |
A, E |
4 |
8 |
13 |
|
H |
G |
1 |
2 |
4 |
Part a) Draw the project network and determine the critical path in the project network using most likely activity durations. (Show the network, total flow of each activity, and critical path)
Part b) How many days activity F could be delayed its early start date without delaying the start date of other activities? (Explanations and calculations)
Part c) If company’s president wants to have a 95% chance of completing the project before July 30, when should the project began? (Explanations and calculations)
In: Operations Management
Write a python program to evaluate polynomials in general and test it on the following polynomial: ? 4 − 3? 3 − 39? 2 + 47? + 90 = 0
a) Develop and test a function named polyCalc() that evaluates a polynomial at a given value of the variable. The function receives two arguments: a list of the polynomial coefficients, and the value of the variable. It returns the result of the evaluation as a float. Use your function to evaluate the polynomial at ? = -5.4, -5.2, -1.2, -1.0, 2.0, 2.2, 7.2 and 7.4. What do you conclude about the solutions to the equation above?
b) Write a second function named polySolve() that seeks a solution of the polynomial between two values of the variable where the function has changed sign. This function should receive the list of coefficients, the two values of the variable between which there is a solution. It should return the value of the variable at which a solution was found. This function may be based on an exhaustive search, a bisection search, or on Newton-Raphson’s method. Select a method with some justification.
In: Computer Science
In: Computer Science
A company which produces a single product has definite orders for this product over the next four quarters as follows:
| Quarter | 1 | 2 | 3 | 4 |
| Demand | 460 | 600 | 340 | 500 |
The company ended the previous year with an inventory of 300 units, and the final quarter production level was 420 units. The company wishes to end this year with an inventory of at least 280 units.
It costs $30 per unit to increase the production level from one quarter to the next, and $56 per unit to decrease it. The cost of holding inventory from one quarter to the next is $40 per unit per quarter. No shortages are permitted. The company wishes to minimize the sum of production level change costs and inventory costs over the four quarter planning horizon.
Formulate (but do not solve) a model for this situation.
In: Operations Management
THREES ELECTRONICS COMPANY Threes Electronics is a mid-sized electronics manufacturer located in Santa Monica, California. The company president is Jack Tripper, who inherited the company. The company originally repaired radios and other household appliances when it was founded over 70 years ago. Over the years, the company has expanded, and it is now a reputable manufacturer of various specialty electronic items. One of the major revenue-producing items manufactured by Threes Electronic is a Personal Digital Assistant (PDA). Threes Electronics currently has one PDA model on the market and sales have been excellent. The PDA is a unique item in that it comes in a variety of tropical colors and is preprogrammed to play Jimmy Buffet music. However, as with any electronic item, technology changes rapidly, and the current PDA has limited features in comparison with newer models. Threes Electronic spent $750,000 to develop a prototype for a new PDA that has all the features of the existing one, but adds new features such as cell phone capability. The company has spent a further $200,000 for a marketing study to determine the expected sales figures for the new PDA. Threes Electronic can manufacture the new PDA for $86 each in variable costs. Fixed costs for the operation are estimated to run $3 million per year. The estimated sales volume is 70,000, 80,000, 100,000, 85,000, and 75,000 per each year for the next five years, respectively. The unit price of the new PDA will be $250. The necessary equipment can be purchased for $15 million and will be depreciated on a 7-year MACRS schedule. It is believed the value of the equipment in five years will be $3 million. Net working capital for the PDAs will be 20 percent of sales and will occur with the timing of the cash flows for the year (i.e., there is a no initial outlay for NWC). Changes in NWC will thus first occur in Year 1 with the first year’s sales. Threes Electronic has a 35 percent (federal & state) corporate tax rate. Threes Electronic plans to finance by a combination of 1/3 debt and 2/3 internal equity (i.e., retained earnings). The beta of the firm’s stock is 1.75. The firm uses a risk-free rate of 4% and the market risk premium of 7%. Threes has 15,000 9 percent semi-annual coupon bonds outstanding, $1,000 par value per bond, 15 years to maturity, selling for 108 percent of par. Threes Electronic can issue bonds for $5 ~ $6 million in the similar terms. Construct a project cash flow statement; estimate the cost of capital; and provide NPV, IRR, payback period (our target PB is 3 years) and profitability index of this project.
In: Finance
800 mL of a 2 M lactic acid buffer at pH=4.2 is mixed with 600 mL of a 1 M lactic acid buffer at pH=3.9. After the two buffer solutions are combined, 300 mL of 1.5 M sodium hydroxide is added to the buffer solution. What is the pH of the solution after the sodium hydroxide has been added? (lactic acid pKa = 3.86)
In: Chemistry
Write 3 detailed samples of scary text-based computer games. The location of your game could be a place that truly exists (possibly include research). Exclude graphic content. Remember to give choices to the player during the game.
In: Computer Science
Teloxy Engineering has received a one-time contract to design and build 10,000 units of a new product. During the proposal process, management felt that the new product could be designed and manufactured at a low cost. One of the ingredients necessary to build the product was a small component that could be purchased for $60 in the marketplace, including quantity dis- counts. Accordingly, management budgeted $650,000 for the purchasing and handling of 10,000 components plus scrap.
During the design stage, your engineering team informs you that the final design will require a somewhat higher-grade component that sells for $72 with quantity discounts. The new price is substantially higher than you had budgeted for. This will create a cost overrun.
You meet with your manufacturing team to see if they can manufacture the component at a cheaper price than buying it from the outside. Your manufacturing team informs you that they can produce a maximum of 10,000 units, just enough to fulfill your contract. The setup cost will be $100,000 and the raw material cost is $40 per component. Since Teloxy has never manu- factured this product before, manufacturing expects the following defects:
Percent defective 0 10 20 30 40 Probability of 10 20 30 25 15
occurrence
All defective parts must be removed and repaired at a cost of $120
per part.
In: Operations Management
Embassy Club Condominium, located on the west coast of Florida, is undertaking a summer renovation of its main building. The project is scheduled to begin May 1, and a September 1 (17-week) completion date is desired. The condominium manager identified the following renovation activities and their estimated times:
| Immediate | ||
| Activity | Predecessor | Time |
| A | — | 3 |
| B | — | 4 |
| C | — | 2 |
| D | A, B, C | 2 |
| E | A, D | 8 |
| F | C, D | 7 |
| G | D, E | 5 |
| H | F | 7 |
| (i) | (ii) | ||
| (iii) | (iv) |
| Earliest | Latest | Earliest | Latest | Critical | ||||||||
| Activity | Start | Start | Finish | Finish | Slack | Activity | ||||||
| A | ||||||||||||
| B | ||||||||||||
| C | ||||||||||||
| D | ||||||||||||
| E | ||||||||||||
| F | ||||||||||||
| G | ||||||||||||
| H | ||||||||||||
In: Operations Management
a. In Season 2 of Breaking Bad, Jesse and Heisenberg end up stranded in the desert because the battery of the RV is dead. Walter builds a homemade battery to jumpstart the engine. He uses brake pads that contain mercuric oxide (HgO) and galvanized steel which is a source of Zn metal. The electrolyte he uses is KOH. Relevant data can be found in Appendix B. (Below)
i. Write down the relevant half reactions.
ii. What is the overall spontaneous electrochemical reaction?
iii. Calculate the standard potential for this reaction.
iv. If the pH of the electrolyte is 12 and the concentration of zinc ions is 0.01 M what is the cell potential?
b. Silver can be electroplated at the cathode of an electrolysis cell by the half-reaction:
Ag+(aq) + e- ---> Ag(s)
What mass of silver would plate onto the cathode if a current of 6.8 A flowed through the cell for 72 min?
Appendix B: Standard reduction potentials for selected half reactions
|
Half reaction |
E0red (V) |
|
O2(g) + 4H+(aq) + 4 e- ® 2 H2O(l) |
1.23 |
|
Hg22+(aq) + 2 e- ® 2 Hg(l) |
0.85 |
|
Ag+(aq) + e- ® Ag(s) |
0.80 |
|
Fe3+(aq) + e- ® Fe2+(aq) |
0.77 |
|
HgO(s) + H2O (l) + 2e- ® Hg(s) + 2OH- |
0.098 |
|
2H+(aq) + 2 e- ® H2(g) |
0.00 |
|
Ni2+(aq) + 2 e- ® Ni(s) |
-0.26 |
|
Cd2+(aq) + 2 e- ® Cd(s) |
-0.40 |
|
Zn2+(aq) + 2e- ® Zn(s) |
-0.76 |
|
2 H2O(l) + 2 e- ® H2 + 2 OH-(aq) |
-0.83 |
|
Na+(aq) + e- ® Na(s) |
-2.71 |
I need to know how to do these questions not just the answers, thank you!
In: Chemistry
What are the 3 components of Expectancy Theory. Do you think this describes how people are motivated? How should you get subordinates excited when they are not motivated about work.
In: Operations Management
This program will determine the letter grade for a student. It will ask for scores (could be labs, activities, quizzes, or projects) and then display some basic statistics derived from the scores.
In Python, Write a program that continuously asks for a non-negative score until the user enters -1. IF the user enters a valid score ask for the possible score for that assignment, we will not assume all scores will have the same maximum value. We will assume that no one will receive a score of 0 on any assignment IF anything it is actually turned in, meaning a score of 0 indicates that the score was not turned it. It’s still the score for the assignment, but this fact will be used later in the assignment. Once all of the scores have been entered display the following information:
• Total number of scores entered. • Total points for the student. • Total number of possible points • Class percentage, with 2 decimal place. • Letter grade using the 90, 80, 70, 60 grading scale. • If we believe the student has dropped. We will assume this is true if ALL of the entered scores are 0 (indicating that nothing was turned it). • If all of the scores were turned in or if the student is missing at least one score
In: Computer Science
Required information Great Adventures Problem AP3-1 [The following information applies to the questions displayed below.] Tony and Suzie graduate from college in May 2021 and begin developing their new business. They begin by offering clinics for basic outdoor activities such as mountain biking or kayaking. Upon developing a customer base, they’ll hold their first adventure races. These races will involve four-person teams that race from one checkpoint to the next using a combination of kayaking, mountain biking, orienteering, and trail running. In the long run, they plan to sell outdoor gear and develop a ropes course for outdoor enthusiasts. On July 1, 2021, Tony and Suzie organize their new company as a corporation, Great Adventures Inc. The articles of incorporation state that the corporation will sell 36,000 shares of common stock for $1 each. Each share of stock represents a unit of ownership. Tony and Suzie will act as co-presidents of the company. The following transactions occur from July 1 through December 31. Jul. 1 Sell $18,000 of common stock to Suzie. Jul. 1 Sell $18,000 of common stock to Tony. Jul. 1 Purchase a one-year insurance policy for $4,320 ($360 per month) to cover injuries to participants during outdoor clinics. Jul. 2 Pay legal fees of $1,500 associated with incorporation. Jul. 4 Purchase office supplies of $1,400 on account. Jul. 7 Pay for advertising of $370 to a local newspaper for an upcoming mountain biking clinic to be held on July 15. Attendees will be charged $40 on the day of the clinic. Jul. 8 Purchase 10 mountain bikes, paying $12,300 cash. Jul. 15 On the day of the clinic, Great Adventures receives cash of $2,800 from 70 bikers. Tony conducts the mountain biking clinic. Jul. 22 Because of the success of the first mountain biking clinic, Tony holds another mountain biking clinic and the company receives $3,350. Jul. 24 Pay $960 to a local radio station for advertising to appear immediately. A kayaking clinic will be held on August 10, and attendees can pay $110 in advance or $160 on the day of the clinic. Jul. 30 Great Adventures receives cash of $7,700 in advance from 70 kayakers for the upcoming kayak clinic. Aug. 1 Great Adventures obtains a $40,000 low-interest loan for the company from the city council, which has recently passed an initiative encouraging business development related to outdoor activities. The loan is due in three years, and 6% annual interest is due each year on July 31. Aug. 4 The company purchases 14 kayaks, paying $20,400 cash. Aug. 10 Twenty additional kayakers pay $3,200 ($160 each), in addition to the $7,700 that was paid in advance on July 30, on the day of the clinic. Tony conducts the first kayak clinic. Aug. 17 Tony conducts a second kayak clinic, and the company receives $11,900 cash. Aug. 24 Office supplies of $1,400 purchased on July 4 are paid in full. Sep. 1 To provide better storage of mountain bikes and kayaks when not in use, the company rents a storage shed for one year, paying $3,240 ($270 per month) in advance. Sep. 21 Tony conducts a rock-climbing clinic. The company receives $14,000 cash. Oct. 17 Tony conducts an orienteering clinic. Participants practice how to understand a topographical map, read an altimeter, use a compass, and orient through heavily wooded areas. The company receives $18,000 cash. Dec. 1 Tony decides to hold the company’s first adventure race on December 15. Four-person teams will race from checkpoint to checkpoint using a combination of mountain biking, kayaking, orienteering, trail running, and rock-climbing skills. The first team in each category to complete all checkpoints in order wins. The entry fee for each team is $500. Dec. 5 To help organize and promote the race, Tony hires his college roommate, Victor. Victor will be paid $40 in salary for each team that competes in the race. His salary will be paid after the race. Dec. 8 The company pays $1,800 to purchase a permit from a state park where the race will be held. The amount is recorded as a miscellaneous expense. Dec. 12 The company purchases racing supplies for $2,900 on account due in 30 days. Supplies include trophies for the top-finishing teams in each category, promotional shirts, snack foods and drinks for participants, and field markers to prepare the racecourse. Dec. 15 The company receives $20,000 cash from a total of forty teams, and the race is held. Dec. 16 The company pays Victor’s salary of $1,600. Dec. 31 The company pays a dividend of $3,500 ($1,750 to Tony and $1,750 to Suzie). Dec. 31 Using his personal money, Tony purchases a diamond ring for $4,900. Tony surprises Suzie by proposing that they get married. Suzie accepts and they get married! The following information relates to year-end adjusting entries as of December 31, 2021. Depreciation of the mountain bikes purchased on July 8 and kayaks purchased on August 4 totals $8,500. Six months’ of the one-year insurance policy purchased on July 1 has expired. Four months of the one-year rental agreement purchased on September 1 has expired. Of the $1,400 of office supplies purchased on July 4, $270 remains. Interest expense on the $40,000 loan obtained from the city council on August 1 should be recorded. Of the $2,900 of racing supplies purchased on December 12, $140 remains. Suzie calculates that the company owes $13,700 in income taxes. Part 7 Post the closing entries of retained earnings to the T-account.
How do I post to the T-account?
In: Accounting