CMPS 221, Programming Fundamentals Assignment 1: Edit, Compile and Run Simple programs For each of all the following question, write a C++ program, compile and run the program. 1. Use the sizeof(type) to find out the number of bytes used for variable of a given type. Read /usr/include/values.h file, and use MINSHORT, MININT, MINLONG, MINSFLOAT, MINDOUBLE MAXSHORT, MAXINT, MAXLONG, MAXSFLOAT, MAXDOUBLE to find out the smallest and largest numbers that can be stored in variable short, int, long, flat, double variable. Notice that (1) No minimum or maximum are defined for char and bool types. (2) To use those MINs and MAXs, you have to include values.h in your program. Write a progrm that will print out the following table: Type Size/Bytes Minimun Maximum =========================================================================== short 2 -32768 32767 int 4 -2147483648 2147483647 long 8 -9223372036854775808 9223372036854775807 float 4 1.17549e-38 3.40282e+38 double 8 2.22507e-308 1.79769e+308 char 1 bool 1 =========================================================================== 2. Write a program which will A. Ask for length of one side of a square (a whole number in foot), B. Calculate the area and the perimeter of the square, and C. Display the area and perimeter of the square on the screen. 3. Write a temperature conversion program that A. Asks for a temperature in Fahrenheit (float-point number). B. Converts the the temperature in Celsius degree (use the formula C = (F-32.0) * 5.0/9.0 in the conversion). C. Prints out the message as follow: xxxx degree in Fahernheit = yyyy degree in Celsius 4. Write a program to caculate the bags of cement needed for a project. The program will A. Ask length, width and depth of the area that you will lay the cement on (those are floating-point numbers). B. Caculate the volume of area. C. Assume that each bag of cement is one cubic feet, or ask for the cubic feet of each, then calculate how many bags of the cenemt are needed. D. Ask the price of a bag of cement. E. Calculate the total cost of cement for the project. F. Print out he following information: Volume of the Area: 103.23 cubic feet Number of bags of cement: 25 (or 103) bags Total cost of cement: $ 342.98