Welcome to the discussion portal. A place to gain and share knowledge. Here you can ask questions
and connect with people who contribute unique insights and quality answers. It is a place for people
from around the world to ask and answer questions, and to learn from that process. Every piece of
content on the site is generated by users, meaning it is created, edited, and organized by the same
people that use the website.
{ delete [] data; } int dynArr::getValue(int index) { //write the code } void dynArr::setValue(int index, int value) { //write the code }
Using C++ modify the header and the source files. Add a member function void allocate(int s) which allows you to change the size of the array. Make sure that memory is not leaked.
Problem Handout Using singularity functions, determine the equations for the internal shear force and bending moment. Draw the shear and moment diagrams and determine the internal bending moment at the point x 4 m from the left side of the beam. 8 kN 15 kN/m 20 kN-m -2 mf1 m- -2 m 3 m
Use static variable annual tax rate to store the annual tax rate for all employees. Also use another static variable inflationRate [0-1].
Use inline initialization for inflation rate = 0.3, whereas the annual tax rate is initialized using the following rule in a static init block.
If inflationRate is higher than 0.5, then annualTaxRate is 5%, else annualTaxRate is 10%.
Each object of the Employee class contains private instance variables name and salary indicating the employee name and monthly salary of the employee.
Provide constructor(s) and getter/setter methods. The constructor and getter/setter methods should use shadowing parameters names. (hint: use ‘this’ )
Provide method computeAnnualTax to calculate the monthly interest by multiplying the Annual salary by annual tax rate divided by 100 – this tax should be returned from computeAnnualTax.
Write class EmpTest for testing the Employee class
Create an employee object emp1 by calling constructors with appropriate values (salary = 20000).
Create another employee object emp2 having default salary (say 30000)
Input salary from the user and update the salary of emp2 to the new salary (say 50000).
Compute Annual tax for both the employees and display them in the test class.
If the price of gasoline doubled, how would consumption of (a) cars, (b) public transportation, and (c) in-theater movies be affected? How quickly would these adjustments be made?
Create class Employee. · Use static variable annualTaxRate to store the annual tax rate for all employees. Also use another static variable inflationRate [0-1]. · Use inline initialization for inflationRate = 0.3, whereas annualTaxRate is initialized using the following rule in a static init block. · If inflationRate is higher than 0.5, then annualTaxRate is 5%, else annualTaxRate is 10%. · Each object of the Employee class contains private instance variables name and salary indicating the employee name and monthly salary of the employee. · Provide constructor(s) and getter/setter methods. The constructor and getter/setter methods should use shadowing parameters names. (hint: use ‘this’ ) · Provide method computeAnnualTax to calculate the monthly interest by multiplying the Annual salary by annualTaxRate divided by 100 – this tax should be returned from computeAnnualTax.
} Write class EmpTest for testing the Employee class } Create an employee object emp1 by calling constructors with appropriate values (salary = 20000). } Create another employee object emp2 having default salary (say 30000) 2 / 2 } Input salary from user and update the salary of emp2 to the new salary (say 50000). } Compute Annual tax for both the employees and display them in the test class.
***Update the employee class so that it contains another instance variable called netMonthlyIncome, which is defined as monthly salary minus(-) monthly income tax. Add a method to the class Employee called computeNetSalary to compute it.
You need to determine an interest rate to use—select an interest rate and explain why you think this number should be used. Use it in your calculations in item 1.2.
Given the information below on options 1 and 2, carry out three forms of analysis: breakeven, ROI, and NPV.
Make a recommendation on which way to proceed, based on the TCO for each option.
Option 1: Purchase the FunSoft package: Cost $200,000 for software and $85,000 for hardware in year one; with $50,000 to customize it and a $40,000 annual licensing fee for the life of the contract. There will be an annual saving of $61,000 due to the layoff of a clerk.
Option 2: Purchase the SoftComm package, which will operate on the vendor’s hardware: Cost $250,000 for a five-year license, payable half up front and half during the first year of implementation. The maintenance contract, at $75,000 a year, includes all currently identified modifications to the software for the first three years. The clerk’s hours will be cut by half, for a saving of $25,000 a year.
In both cases, sales are expected to increase from the current $1 million a year, by 10% per year each year (over each year’s previous year’s sales) after full implementation.
A requirement for scientific work is that what we have done can be reproducible, which means that when using the same input and the same models, we should arrive at the same results. Will a risk assessment meet this requirement?
Problem #4: (a) Compute the Unit Hydrograph for the Effective rainfall-direct runoff storm as summarized below. 1.00 pm Time (Hours) 10.00 am Effective Rainfall intensity (cm/hour) 10.00 Direct Runoff Rate (cm/hour) 0.0 11:00 am 0.0 10.00 0.0 (b) For a watershed comprising of 5220 hectares in area, the rainfall and runoff data are summarized below in the Table. The maximum runoff rate was recorded as 4.82 m/s at hour 9 on the second day. Compute (a) a 6-hr Unit Hydrograph, (b) a 12-hr unit hydrograph, and (c) a runoff hydrograph for the complex rain sequence as: 6-hr rainfall with rainfall intensity of 2 mm/hr, followed by 6-hr rainfall with rainfall intensity of 7 mm/hr, and the last 6-hr rainfall with rainfall intensity of 11 mm/hr. (d) Determine the maximum runoff rate for the complex rain storm described in part-c. Rainfall Data Day Hour Intensity (mm/hr) Day-1 20 21 22 23 0.5 0.5 0.5 2.7 24 Day-2 1 2 3 4 5.2 1.7 1.3 1.1 5 1.3 1.0 Runoff Data Day Hour Intensity (m/s) 8 12 0.56 0.61 Day-1 Day-2 16 20 24 4 8 12 16 20 24 0.61 0.590.66 3.35 4.75 4.25 2.40 1.25 1.10 Runoff Data Day Hour Intensity (m/s) Day-3 Day-4 4 8 12 16 20 24 4 8 12 16 20 24 0.94 0.89 0.84 0.79 0.74 0.70 0.68 0.65 0.64 0.62 0.590.59