Question: COMP 1213/1211 Lab Assignment 2 For each of the programming problems below, submit an algorithm (saved in a word or pdf document), the source (.cpp)

COMP 1213/1211 Lab Assignment 2 For each of the programming problems below, submit an algorithm (saved in a word or pdf document), the source (.cpp) file, and program output by the due date and time. Late assignments will not be accepted. You can place all the algorithms in one file. You con place all the program outputs in one file. Program 1 Write a C++ program that calculates and prints both solutions to the quadratic equation when a-2, 6-10, and c-4. Print each of the solutions to 2 decimal places with identifying text. (Your program must use the cmath square root function.) -btJb.de 2a Program 2 Write an interactive C++ program that reads in a person's social security number in the format XOCX-XX- xox and the person's first name and last name. The program should create and print a default username for the person that consists of the first initial of the first name, the last name, and the last 4 digits of the social security number. The program should print the person's name and the username that was created. (Hint: use in to read in the person's first name, last name, and SSN. Your program should use the string functions ons and string concotenction. For example, if the user enters in Michael for the first name and Watkins for the last name and 121-23- 2222 for the social security number. The username should be mwatkins2222. Use the tolower function from the coctype> library to convert the initials to lower case letters. Program 3 Write an interactive C++ program that will print a business card for a person and calculate the cost to print it. The program should read in the person's name, address, phone number, and email address. The program should calculate the cost to print the person's business card based on the total number of characters on each output line. Declare the cost per character as a constant variable with a value of $0.15. The program should print the card information out on separate output lines. The program should print the cost. (Hint: use the getline function to read in the data; determine the total number of characters using the string functions in Chapter 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
