Question: using System; using static System.Console; using System.Globalization; class DebugEight 1 { static void Main ( ) { int orderNum, quantity; double total; const double PRICE

using System;
using static System.Console;
using System.Globalization;
class DebugEight1
{
static void Main()
{
int orderNum, quantity;
double total;
const double PRICE_EACH =3.99;
// Call GetData with 'out' parameters
GetData(out orderNum, out quantity);
// Calculate total cost
total = quantity * PRICE_EACH;
// Display the order details and total cost
WriteLine("Order #{0}. Quantity ordered ={1}", orderNum, quantity);
WriteLine("Total is {0}", total.ToString("C", CultureInfo.GetCultureInfo("en-US")));
}
public static void GetData(out int order, out int amount)
{
string s1, s2;
// Prompt user for order number
Write("Enter order number: ");
s1= ReadLine();
// Prompt user for quantity
Write("Enter quantity: ");
s2= ReadLine();
// Convert input strings to integers
order = Convert.ToInt32(s1);
amount = Convert.ToInt32(s2);
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!