Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6636321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:10:16+00:00 2026-05-25T23:10:16+00:00

ok so this program keep falling apart at the first if statement and keep

  • 0

ok so this program keep falling apart at the first “if” statement and keep bringing me to caragory B any tips?where is it failing? what code needs to be added or taken out?

using System;

class Program
{
    enum Numbers { standard = 1, express = 2, same = 3 };

    const int A = 1, B = 2;
    const int Y = 3, N = 4;
    static void Main()
     {

        double cost, LB;
        int Number_of_items ;
        int myNumbers;
        char catagory = 'A';
        char surcharge = 'Y';

        Console.WriteLine("please enter the type of shiping you want");
        Console.WriteLine("Enter 1:standard shipping.");
        Console.WriteLine("Enter 2:express shipping.");
        Console.WriteLine("Enter 3:same day shipping.");

        myNumbers = int.Parse(Console.ReadLine());
        switch ((Numbers)myNumbers)
        { 
            case Numbers.standard:
                Console.WriteLine("thankyou for chooseing standerd shipping");
                Console.WriteLine("please choose a catagory");
                Console.Write("Type A or B to make your selection");
                catagory = char.Parse(Console.ReadLine());
                {      if (catagory==A)
                {
                    Console.Write("please enter the number of items");
                    Number_of_items = int.Parse(Console.ReadLine());
                    cost = 3 * Number_of_items;

                    Console.Write("is this shipment going to alaska or Hawaii? (Y or N)");
                    if (surcharge==Y)
                    {
                        cost = cost + 2.50;

                        Console.WriteLine("Total cost is {0}." , cost);
                    }
                    else 
                        Console.WriteLine("total cost is {0}." , cost);


                }
                else
                    Console.Write("please enter the weight in pounds");
               LB =  double.Parse(Console.ReadLine());
                cost = 1.45 * LB;
                Console.WriteLine("is this shipment going to alaska or Hawaii? (Y or N)");
        }
                if (surcharge==Y)
                {
                    cost = cost + 2.50;

                        Console.WriteLine("Total cost is {0}." , cost);
                }
                else 
                        Console.WriteLine("total cost is {0}." , cost);

                break;


                case Numbers.express:
                Console.WriteLine("thankyou for chooseing Express Shipping");
                Console.WriteLine("please choose a catagory");
                Console.Write("Type A or B to make your selection");
                catagory = char.Parse(Console.ReadLine());
                    {       if (catagory==A)
                        Console.Write("please enter the number of items");
                        Number_of_items = int.Parse(Console.ReadLine());
                        cost = 4 * Number_of_items;
                        {
                    Console.Write("is this shipment going to alaska or Hawaii? (Y or N)");
                    if (surcharge==Y)
                    {
                        cost = cost + 5.00;

                        Console.WriteLine("Total cost is {0}." , cost);
                    }
                    else 
                        Console.WriteLine("total cost is {0}." , cost);


                    }
                        if (surcharge==B)


                            Console.Write("please enter the weight in pounds");
               LB =  double.Parse(Console.ReadLine());
                cost = 2.50 * LB;
                Console.WriteLine("is this shipment going to alaska or Hawaii? (Y or N)");
                    }
                if (surcharge==Y)
                {
                    cost = cost + 5.00;

                        Console.WriteLine("Total cost is {0}." , cost);
                }
                else 
                        Console.WriteLine("total cost is {0}." , cost);
            break;





                case Numbers.same:
                Console.WriteLine("thankyou for chooseing Same Day Shipping");
                Console.WriteLine("please choose a catagory");
                Console.Write("Type A or B to make your selection");
                catagory = char.Parse(Console.ReadLine());
                if (catagory == A)
                    Console.Write("please enter the number of items");
                    Number_of_items = int.Parse(Console.ReadLine());
                    cost = 5.50 * Number_of_items;

                    Console.Write("is this shipment going to alaska or Hawaii? (Y or N)");
                    if (surcharge==Y)
                    {
                        cost = cost + 8.00;

                        Console.WriteLine("Total cost is {0}." , cost);
                    }
                    else 
                        Console.WriteLine("total cost is {0}." , cost);



                if (surcharge==B)

                    Console.Write("please enter the weight in pounds");
               LB =  double.Parse(Console.ReadLine());
                cost = 3.00 * LB;
                Console.WriteLine("is this shipment going to alaska or Hawaii? (Y or N)");

                if (surcharge==Y)
                {
                    cost = cost + 8.00;

                        Console.WriteLine("Total cost is {0}." , cost);
                }
                else 
                        Console.WriteLine("total cost is {0}." , cost);

                break;
        }
  Console.ReadLine();

    }//End Main()
}//End class Program
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:10:17+00:00Added an answer on May 25, 2026 at 11:10 pm

    A is an int variable to which you assigned the value 1.
    You probably meant to do:
    if (catagory==’A’)
    not
    if (catagory==A)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

OK,First this program can load plist from URL by this code,and I put this
Im trying to use Date Formatters (NSDateFormatter), but I keep getting this error: Program
I am doing a minesweeper program for school, but i keep getting this error
This program takes the first number in a file and indicates how many numbers
In this program I keep a list of duelists that kill the best duelist
I am trying to run this program but i keep getting the error esent.h
Solved When I try to compile this program i keep getting these errors: (50)
I can't seem to get this program to compile. I keep getting the error:
I have a bug in this program, and I keep coming back to these
Update this program is supposed to keep track of the number of times each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.