Programming Assignment: P2

Read the following sample programs to find out the output. Then run the program on computer and compare the output you found manually with the output from computer to make sure
to understand the basic C++ output.

a, b, and c are the constants of the quadratic equation.
You program will ask the user to enter the values for the three constants from keyboard: a, b, and c.
Your program will check if there is any real solution to the equation (i.e. b^2-4ac > 0).
If yes, your program calculates the solutions to the equation and prints them out on screen.
Otherwise, print out a message saying "there is no real solution to the equation." Test your program
with the following two cases: (1) a = 1, b=-1, and c = -1 (2) a = 2, b = 2, and c = 1

String processing. Write a program to break an address into city, state abbreviation, and zip code.
For example, when a user enters an address from keyboard: Fort Worth, TX 76015 your program breaks it into
three parts and print them on screen in format like City=Fort Worth, State=TX, Zipcode=76105
Test your program with these examples: (1) Dallas, TX 76206 (2)Little Elm Town, AK 45306
(3)Fort Worth, TX 76015
You might use getline function to read an address string into a string variable. For example:

int main ()
{
string address;
cout << "Enter an address: " << endl;
getline(cin, address);
//Break the value in variable address into three parts using string functions such as find and substr
//...
//Print the three parts on screen
return 0;
}

At the top section of your program you need to use C++ comments to include your name,
class name, programming assignment name, and date the program was written.

Your programs should be properly formatted using indentation and empty lines (spaces). Use "camel" notation for variable naming.

Upon completion, save all programs and the required output into a single text file using notepad (or notepad++).
The file should be named in this format: P2_YourName.txt, for example, P2_JohnDoe.txt.
Then submit to the Blackboard (Bb) as attachment by the deadline. The submission link on the Bb
will be closed automatically after the deadline. Assignments that fail to follow the instructions will NOT
be graded.