Question

In: Computer Science

please debug this so that it will compiler: C# // Uses PrintWebAddress method three times using...

please debug this so that it will compiler: C#

// Uses PrintWebAddress method three times
using System;
public class DebugSix2
{
   public void Main()
   {
      PrintWebAddress();
      Console.WriteLine("Shop at Shopper's World");
      PrintWebAddresses();
      Console.WriteLine("The best bargains from around the world");
      PrintWebAddress;
   }
   public void PrintWebAddress()
   {
      Console.WriteLine(------------------------------");
      Console.WriteLine(Visit us on the web at:");
      Console.WriteLine(www.shoppersworldbargains.com");
      Console.WriteLine(******************************");
   }
}

Solutions

Expert Solution

// Uses PrintWebAddress method three times

using System;

public class DebugSix2
{
    public static void Main()
    {
        PrintWebAddress();
        Console.WriteLine("Shop at Shopper's World");
        PrintWebAddress();
        Console.WriteLine("The best bargains from around the world");
        PrintWebAddress();
    }

    public static void PrintWebAddress()
    {
        Console.WriteLine("------------------------------");
        Console.WriteLine("Visit us on the web at:");
        Console.WriteLine("www.shoppersworldbargains.com");
        Console.WriteLine("******************************");
    }
}


Related Solutions

Please debug this by fixing all the mistakes so it will compile in C# // Program...
Please debug this by fixing all the mistakes so it will compile in C# // Program prompts user for any number of values // (up to 20) // and averages them using System; public class DebugFive04 {     public static void Main()     {         const int QUIT = 999;         int[] numbers = new int[20];         int x;         int num;         double average;         double total;         string inString; // intString         Console.Write("Please enter a number or "...
Please Complete this C Code using the gcc compiler. Please include comments to explain each added...
Please Complete this C Code using the gcc compiler. Please include comments to explain each added line. /*This program computes the Intersection over Union of two rectangles as a percent: IoU = [Area(Intersection of R1 and R2) * 100 ] / [Area(R1) + Area(R2) - Area(Intersection of R1 and R2)] The answer will be specified as a percent: a number between 0 and 100. For example, if the rectangles do not overlap, IoU = 0%. If they are at the...
please debug this by fixing all the mistakes in C# // Creates a BoatLicense class //...
please debug this by fixing all the mistakes in C# // Creates a BoatLicense class // And instantiates three BoatLicense objects // The price of a licence is $25 if the boat motor is 50 HP or under // and $38 if the HP is over 50 // Boat licenses are issued with numbers starting with 200801 using System; public class DebugSeven4 {    public static void Main()    {       const int STARTINGNUM = 200801;       BoatLicense[] license =...
please debug this by fixing all the mistakes in C#: // Creates a Breakfast class //...
please debug this by fixing all the mistakes in C#: // Creates a Breakfast class // and instantiates an object // Displays Breakfast special information using System; public class DebugSeven2 {    Breakfast special = new Breakfast("French toast", 4.99);    //Display the info about breakfast    Console.WriteLine(Breakfast.info);    // then display today's special    Console.WriteLine("Today we are having {0} for {1}",       special.Name, special.Price.ToString("C2")); } class Breakfast {    // info is class field    public static string info =...
Debug please. It's in C++ #include<iostream> #include<string> using namespace std; class Prescription {    friend ostream&...
Debug please. It's in C++ #include<iostream> #include<string> using namespace std; class Prescription {    friend ostream& operator<<(ostream&, const Prescription&);    friend istream& operator>>(istream&, Prescription&);    private: int idNum; int numPills; double price;    public: Prescription(const int = 0, const int = 0, const double = 0.0); }; Prescription::Prescription(const int id, const int pills, const double p) {    id = id;    numPills = pills;    price = p; } ostream& operator<<(ostream& out, const Prescription pre) {    out <<...
Using c# rewrite/edit the following program so that it runs the simulation 10,000 times (play the...
Using c# rewrite/edit the following program so that it runs the simulation 10,000 times (play the games 10,000 times) and count the number wins. Then calculate the winning probability by using the formula: the expected winning probability = the number of wins / 10,000 using System; class lottery { static void Main() { int n, random, choice = 1; Random randnum = new Random();    while (choice == 1) {    Console.Write("\nEnter a integer from 1 to 5:"); n =...
Debug please. It's in C++ #include<iostream> #include<string> using namespace std; template <class T> double half(int x)...
Debug please. It's in C++ #include<iostream> #include<string> using namespace std; template <class T> double half(int x) { double h = x / 2; return h; } class TuitionBill { friend ostream& operator<<(ostream, TuitionBill); private: string student; double amount; public: TuitionBill(string, double); double operator/(int); }; TuitionBill::TuitionBill(string student, double amt) { student = student; amount = amt; } double TuitionBill::operator/(int factor) { double half = amount / factor; return hafl; } ostream& operator<<(ostream& o, TuitionBill) { o << t.student << " Tuition:...
IN C++ Using newton's method, Please create a SqRoot function. DO NOT USE sqrt ( )...
IN C++ Using newton's method, Please create a SqRoot function. DO NOT USE sqrt ( ) , If you do I will give you zero points period.   So create a function that takes a double and returns a double that is the square root of the number. You must decide what number to start the calculations with, You must decide how and when to stop computing. For this exercise you must tell me ( use comments in your code: /*...
Using the bisection method:     Make a program to use this method using the following three...
Using the bisection method:     Make a program to use this method using the following three functions and use it to find the root of this function f (x) = x * x * x-8. a) A function so that the user between xlower and xupper that meets the value of the function has a different sign and if he does not ask for new values. b) A function to find the root and call it bisection and perform a...
James uses socially appropriate behavior to greet peers but does so up to ten times in...
James uses socially appropriate behavior to greet peers but does so up to ten times in one class period. His teacher decides to use DRL to lower the rate of his behavior but she does not want to eliminate it completely. She decides to deliver reinforcement (ex. computer time) to James if he greets peers five or fewer times during the class period. If he greets peers more than five times, he does not receive reinforcement. Do you believe this...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT