I am getting error messages and the code won't build.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Assignment07
{using System; using System.Collections.Generic; using System.Linq; using System.Text;
namespace Assignment07 { class Dog { public void bark(string dogsName) { Console.WriteLine(dogsName + " is barking"); } public void run(string dogsName) { Console.WriteLine(dogsName + " is running"); } }
class Program { static void Main(string[] args) {
Dog fido = new Dog();
fido.bark("Fido");
fido.run("Fido");
Console.Write("Hit any key to close"); Console.ReadKey(true); } } }
class Dog
{
static void Main(string[] args)
{
Console.WriteLine("Assignment 07");
Console.WriteLine("This program is written by Vickie Primes");
}
public void bark (string dogsName)
{
int barking = 0;
while(barking < 5){
barking = barking +1;
{
Console.WriteLine(dogsName + " is barking");
public string running { get; set; }}
public void Run(string dogsName)
{
for (var i = 0; i < 10; i++)
running = "1 + 1";
Console.WriteLine(dogsName + "is running");
Dog fido = new Dog();
fido.bark("Fido");
fido.run("Fido");
Console.Write("Hit any key to close"); Console.ReadKey(true);
}
Question
Vickie Primes
I am getting error messages and the code won't build.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Assignment07
{using System; using System.Collections.Generic; using System.Linq; using System.Text;
namespace Assignment07 { class Dog { public void bark(string dogsName) { Console.WriteLine(dogsName + " is barking"); } public void run(string dogsName) { Console.WriteLine(dogsName + " is running"); } }
class Program { static void Main(string[] args) {
Dog fido = new Dog();
fido.bark("Fido");
fido.run("Fido");
Console.Write("Hit any key to close"); Console.ReadKey(true); } } }
class Dog
{
static void Main(string[] args)
{
Console.WriteLine("Assignment 07");
Console.WriteLine("This program is written by Vickie Primes");
}
public void bark (string dogsName)
{
int barking = 0;
while(barking < 5){
barking = barking +1;
{
Console.WriteLine(dogsName + " is barking");
public string running { get; set; }}
public void Run(string dogsName)
{
for (var i = 0; i < 10; i++)
running = "1 + 1";
Console.WriteLine(dogsName + "is running");
Dog fido = new Dog();
fido.bark("Fido");
fido.run("Fido");
Console.Write("Hit any key to close"); Console.ReadKey(true);
}
public string running { get; set; }}
Link to comment
https://www.neowin.net/forum/topic/1311512-c-programming-my-assignment-was-to-write-code-making-fido-bark-5-times-while-loop-and-run-10-times-for-loop/Share on other sites
4 answers to this question
Recommended Posts