Question: C++ write a code Write a program that calculates the price of a carpet given the pattern, color, and longest size. First, the program will

C++ write a code
Write a program that calculates the price of a carpet given the pattern, color, and longest size. First, the program will read the pattern (carpetPattern) as a std::string, color (carpetColor) as a char and finally the longest size of the carpet (carpetLongestSize) as an int IN THIS ORDER. Then, based on the table given below the program will calculate the price and print it out as an int. Color Pattern = G Pattern = MER Pattern = KO Longest Size Y B. R Y B O o Y B R O R 6 1 5 5 un 5 un 6 6 6 8 8. 00 N 12 12 12 17 17 23 23 23 23 20 20 20 20 25 25 30 30 17 30 40 3 4 30 30 30 W 30 27 29 31 33 56 45 45 45 NOTE: The patterns will ALWAYS be given as either G, MER, or KO. NOTE: The color will ALWAYS be given as Y, B, R, or O. NOTE: The longest size will ALWAYS be given as 1, 2, 3, or 4. GR 3 MER Y 4 MER B 4 Input Output 20 27 29 Answer assignment
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
