Reference no: EM132161001
Assignment -
1. Write C++ statements: write a statement for each of the following:
a. Print integer 40000 left justified in a 15-digit field.
b. Read a string into character array variable state.
c. Print 200 with and without a sign.
d. Print the decimal value 100 in hexadecimal form preceded by 0x.
e. Read characters into array charArray until the character 'p' is encountered, up to a limit of 10 characters (including the terminating null character). Extract the delimiter 'p' from the input stream, and discard it.
f. Print 1.234 in a 9-digit field with preceding zeros.
2. Write a program that converts integer Fahrenheit temperatures from 0 to 212 degrees to floating-point Celsius temperatures with 3 digits of precision. Use the formula celsius = 5.0 / 9.0 * (fahrenheit - 32);
3. Write a program that accomplishes each of the following:
a. Create a user-defined class Point that contains the private integer data members x-Coordinate and y-Coordinate and declares stream insertion (<<) and stream extraction (>>) over-loaded operator functions as friends of the class.
b. Define the stream insertion and stream extraction operator functions. The stream extraction operator function should determine whether the data entered is valid, and, if not, it should set the failbit to indicate improper input.
input.setstate(std::ios::failbit);
The stream insertion operator should not be able to display the point after an input error occurred.
c. Write a main function that tests input and output of user-defined class Point, using the overloaded stream extraction and stream insertion operators.
d. See Fig 10.3 to Fig 10.5 for examples, page 456-457 of the C++ book.
How you would approach a health education program
: Explain how you would approach a health education program for African Americans and Diabetes. Support your choices with scholarly references.
|
Determine what the maturity date should be
: A 9%, $10,000 bond that has interest payable semiannually sells for $8500. Determine what the maturity date should be so that the purchaser may enjoy a 12%.
|
Finding the coupon interest rate
: At what coupon interest rate will a $20,000 bond yield a nominal 12% interest compounded quarterly if the purchaser pays $18,000 and the bond becomes.
|
Which healthcare model is better and why
: Compare and contrast the range of medical language interpretation and describe what is considered "best practice."
|
Define the stream extraction operator functions
: CS3528 Assignment - Define the stream insertion and stream extraction operator functions. Write a main function that tests input of of user-defined class Point
|
What symbols do you see on the foods that are irradiated
: What symbols do you see on the foods that are irradiated? What are the requirements for labeling?
|
What nominal and effective rate of return per year were made
: An investor purchased a 5%, $5000 bond for $4000. The interest was payable quarterly, and the bond's maturity was 20 years. The bond was kept for only 9 years.
|
What are some of the major areas that are covered
: What are some of the major areas that are covered? Why are these important to the profession?
|
Find nominal and effective rates of return per year
: A 12%, $50,000 bond is offered for sale at $45,000. If the bond interest is payable monthly and the bond matures in 20 years, what nominal and effective rates.
|