Write a C program which prompts the user for the name of the brand of a phone they would like to purchase. Your program should store the user-entered name in a variable named brand. You should instruct the user to enter a single letter to match each brand ('S' for 'Samsung', 'A' for 'Apple', etc.) and output the amount to be charged based off this table: Brand Samsung Apple Motorola Google LG HTC or Nokia Price $500 $450 $400 $375 $350 $200 For instance, if the user enters "Samsung" as their choice, your program should then display to the user: "You have chosen to purchase a Samsung phone, you will be charged $500". Your program should make sure to validate the input data; if the user enters anything other than the brand names, you should display a message telling them that invalid data has been entered.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter2: Using Data
Section: Chapter Questions
Problem 7E: Write a C# program named ProjectedRaises that includes a named constant representing next years...
icon
Related questions
Question
Write a C program which prompts the user for the name of the brand of a phone they would like to
purchase. Your program should store the user-entered name in a variable named brand. You should
instruct the user to enter a single letter to match each brand ('S' for 'Samsung', 'A' for 'Apple', etc.)
and output the amount to be charged based off this table:
Brand
Samsung
Apple
Motorola
Google
LG
HTC or Nokia
Price
$500
$450
$400
$375
$350
$200
For instance, if the user enters "Samsung" as their choice, your program should then display to the
user: "You have chosen to purchase a Samsung phone, you will be charged $500". Your program
should make sure to validate the input data; if the user enters anything other than the brand names,
you should display a message telling them that invalid data has been entered.
Transcribed Image Text:Write a C program which prompts the user for the name of the brand of a phone they would like to purchase. Your program should store the user-entered name in a variable named brand. You should instruct the user to enter a single letter to match each brand ('S' for 'Samsung', 'A' for 'Apple', etc.) and output the amount to be charged based off this table: Brand Samsung Apple Motorola Google LG HTC or Nokia Price $500 $450 $400 $375 $350 $200 For instance, if the user enters "Samsung" as their choice, your program should then display to the user: "You have chosen to purchase a Samsung phone, you will be charged $500". Your program should make sure to validate the input data; if the user enters anything other than the brand names, you should display a message telling them that invalid data has been entered.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Algebraic Expressions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,