TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Maha
NA
0
326.5k
What’s wrong with this program?
Aug 8 2012 10:00 AM
This is question 4th of the exercise. Whatever wood variety is chosen, output price of the wood is first chosen variety is coming. Please fix the error.
using System;
namespace _5e4
{
class Furniture
{
static void Main(string[] args)
{
string choose, replay;
Console.Write("[P for pine] [O for oak] [M for mahogany] Choose varity: ");
choose = Console.ReadLine();
while (choose == "P" || choose == "O" || choose == "M")
{
if (choose == "P")
Console.WriteLine("\t\t\t\t\t\t\tPine Price $100");
if (choose == "O")
Console.WriteLine("\t\t\t\t\t\t\tOak Price = $225");
if (choose == "M")
Console.WriteLine("\t\t\t\t\t\t\tMahogany Price = $310");
replay = Choose();
}
Console.ReadKey();
}
public static string Choose()
{
Console.Write("\n[P for pine] [O for oak] [M for mahogany] Choose varity: ");
string choose = Console.ReadLine();
return choose;
}
}
}
/*
[P for pine] [O for oak] [M for mahogany] Choose varity:
P
Pine Price $100
[P for pine] [O for oak] [M for mahogany] Choose varity:
O
Pine Price $100
[P for pine] [O for oak] [M for mahogany] Choose varity:
M
Pine Price $100
*/
Attachment:
chapter5-exercises.zip
Reply
Answers (
4
)
Encryption in C and Decryption in C#
virtual world application wpf c# project