alphacentauri
October 25th, 2008, 10:11 PM
THE CODE:
using System;
namespace ProgramOne
{
class ProgramOne
{
static void Main()
{
//Declare variables
double amount, shippingCharge;
//Get the purchase total, calculate shipping charges, and display results
amount = GetAmount();
shippingCharge = DetermineShipCharge();
DisplayResults(amount, shippingCharge);
}
static double GetAmount()
{
//Declare variables
double purchaseTotal;
//Get the amount, parse it, and return it
Console.Write("Please enter the purchase total: ");
purchaseTotal = double.Parse(Console.ReadLine());
//Return the parsed value
return purchaseTotal;
}
static double DetermineShipCharge(double amount)
{
//Declare variables
double shippingCharge;
//Determine shipping charge
if (amount <= 250.00)
shippingCharge = 5.00;
else if (amount >= 250.01)
shippingCharge = 8.00;
else if (amount >= 500.01)
shippingCharge = 10.00;
else if (amount >= 1000.01)
shippingCharge = 15.00;
else if (amount <= 5000.00)
shippingCharge = 15.00;
else
shippingCharge = 20.00;
//Return shipping charge
return shippingCharge;
}
static void DisplayResults(double amount, double shippingCharge)
{
Console.WriteLine("Purchasing {0:C} worth of merchandise results in {1:C} worth of shipping charges.", amount, shippingCharge);
}
}
}
----------------------
first off: the program is supposed to ask for a purchase total then depending on the purchase total amount determine shipping charges then display the shipping charges.
For some reason, in the Main class, in the line "shippingCharge = DetermineShipCharge();", "DetermineShipCharge();" has a blue jagged line under it.. has an error: No overload for method 'DetermineShipCharge' takes '0' arguments
i cant for the life of me figure out whats wrong much less how to correct it. any ideas?
using System;
namespace ProgramOne
{
class ProgramOne
{
static void Main()
{
//Declare variables
double amount, shippingCharge;
//Get the purchase total, calculate shipping charges, and display results
amount = GetAmount();
shippingCharge = DetermineShipCharge();
DisplayResults(amount, shippingCharge);
}
static double GetAmount()
{
//Declare variables
double purchaseTotal;
//Get the amount, parse it, and return it
Console.Write("Please enter the purchase total: ");
purchaseTotal = double.Parse(Console.ReadLine());
//Return the parsed value
return purchaseTotal;
}
static double DetermineShipCharge(double amount)
{
//Declare variables
double shippingCharge;
//Determine shipping charge
if (amount <= 250.00)
shippingCharge = 5.00;
else if (amount >= 250.01)
shippingCharge = 8.00;
else if (amount >= 500.01)
shippingCharge = 10.00;
else if (amount >= 1000.01)
shippingCharge = 15.00;
else if (amount <= 5000.00)
shippingCharge = 15.00;
else
shippingCharge = 20.00;
//Return shipping charge
return shippingCharge;
}
static void DisplayResults(double amount, double shippingCharge)
{
Console.WriteLine("Purchasing {0:C} worth of merchandise results in {1:C} worth of shipping charges.", amount, shippingCharge);
}
}
}
----------------------
first off: the program is supposed to ask for a purchase total then depending on the purchase total amount determine shipping charges then display the shipping charges.
For some reason, in the Main class, in the line "shippingCharge = DetermineShipCharge();", "DetermineShipCharge();" has a blue jagged line under it.. has an error: No overload for method 'DetermineShipCharge' takes '0' arguments
i cant for the life of me figure out whats wrong much less how to correct it. any ideas?