please give to use code visual 2015 c++. give to psedue cod and please show me f
ID: 3854914 • Letter: P
Question
please give to use code visual 2015 c++. give to psedue cod and please show me for output and input.
please show simple and explain detail :) thanks
Note that this problem requires the implementation of a small menu system (see Section 4.10) as well as input validation (see Section 4.11) The menu system can be implemented at our current level with an "if-else-if" ladder or by a switch statement. The input validation can be done with standard "if" statements. Program 4-18 is an excellent model for the solution to this problem, at least as far as the basic structure is concerned. Make sure you understand exactly what is to be calculated in each "package." For example, if Package A is chosen and the user wants 650 minutes, how should the monthly bill be calculated exactly? I suggest you work out those equations in pseudo-code before you begin writing the program. Also, take note of the input validation requirements at the end of the problem (in italics). They specify that only 'A', 'B', or is allowed the for the package. Have your program accept either upper or lower case letters for the package choice (e.g., either 'A' or 'a will choose package 'A'). Anything outside of the range A 'C' or the range 'a' c' should be considered an error Also, note that the problem asks the user to enter how many minutes were used even if Package "C" is chosen. This may seem redundant in the case of Package "C," but it will be useful in the following modification. Consequently, your program should ask both of those questions upExplanation / Answer
#include<stdio.h>
#include<conio.h>
Void main()
{
Char plan, int min;
Float bill;
printf(“Enter the Package needed:”);
scanf(“%c”,plan);
print(“enter the number minutes:”);
scanf(“%”,int);
IF (plan != ‘A’ and plan != ‘a’ and plan !=’B’ and plan != ‘b’ and plan != ‘C’ and plan !=’c’)
{
Printf(“The package selected is not valid. Please select valid Package”);
}
Else
{
Switch(c)
{
Case ‘A’ : If (min > 450)
bill= 39.99+(min-450)*0.45;
else
bill=39.99;
Case ‘a’ : If (min > 450)
bill= 39.99+(min-450)*0.45;
else
bill=39.99;
Case ‘B’: If (min > 900)
bill = 59.99+(min-900)*0.40;
else
bill=59.99;
Case ‘b’ : If (min > 900)
bill = 59.99+(min-900)*0.40;
else
bill=59.99;
Case ‘C’: bill=69.99;
Case ‘c’ : bill=69.99;
}
If (plan=’c’ or plan=’C’)
{
printf(“ Congratulations. You have selected the best package ”);
print(“your monthly bill is: $”, &bill);
}
Else
{
Printf(“your monthly bill is : $”,&bill);
Printf(‘ We had better options available than the selected one below ”);
Printf(“The best package is Package C with $69.99 per month and unlimited minutes provided”);
}
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.