Question
This is in c#: This picture above is the correct output of the code that I have attached below. There are errors in the code
This is in c#:
This picture above is the correct output of the code that I have attached below. There are errors in the code that have to be fixed in order for the out put to match.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Find_Errors
{
class Program
{
static void Main(string[] args)
{
// Find and fix the errors
String myName = "John Doe";
String my Job = "\"Cat Wrangler\";
double myRatePerCat = 7.50
decimal totalPay = 0;
int numberOfCats = 40;
boolean employed = true; //Make sure you use this variable
Console.WriteLine("Hello! My name is " + myName ".");
Console.WriteLine("I'm a " + myJob + ".");
Console.WriteLine("My current assignment has me wrangling" + numberOfCats + " cats.");
Console.WriteLine("So, let's get to work!");
while (numberOfCats > 0) //Do Not Change This line
{
if (employed = true)
{
totalPay -= myRatePerCat;
System.out.println("I've wrangled another cat and I have made $"+totalPay+" so far. Only " + numberOfCats + " left!");
}
else
{
System.out.println("I've been fired! Someone else will have to wrangle the rest!");
continue;
};
numberOfCats--;
if (numberOfCats == 5)
{
employed == true;
}
}
}
}
}
- \\vmware-host \Shared Folders\Desktop\Desktop\Class MaterialSDI C# Assignment s14 FindErrorscond\SDI Find Errors-Condit onals FixedbintDebug CMD.EXE was started with the above path as the current directory UNC paths are not supported. Defaulting to Windows directory ello! My name is John Doe I'm a "Cat Wrangler". y current assignment has me wrangling 40 cats So, let's get to work! I've wrangled another cat and I have made $7.5e so far Only 40 leftl I've wrangled another cat and I have made $15.00 so far Only 39 left! I've wrangled another cat and I have made $22.50 so far Only 38 left! I've wrangled another cat and I have made $30.60 so far Only 37 left! I've wrangled another cat and I have made $37.50 so far Only 35 left! I've wrangled another cat and I have made $45.00 so far Only 35 left! I've wrangled another cat and I have made $52.50 so far Only 34 left! 1've wrangled another cat and I have made %68.00 so far Only 33 leftl I've wrangled another cat and I have made %67.5e so far. Only 32 left! I've wrangled another cat and I have made $75,00 so far Only 31 left! I've wrangled another cat and I have made $82.50 so far Only 30 leftl I ve wrangled another cat and I have made $90.90 so far Only 29 left! I've wrangled another cat and I have made $97.50 so far Only 28 left! I've wrangled another cat and I have made $105.80 so far Only 27 left! I've wrangled another cat and I have made $112.58 so far Only 26 left! I've wrangled another cat and Only 25 left! I've wrangled another cat and I have made $127.50 so far Only 24 left! I've wrangled another cat and I have made $135,0 so far Only 23 left! I've wrangled another cat and I have made $142.58 so far Only 22 left! I've wrangled another cat and I have made $150. so far Only 21 left! I've wrangled another cat and I have made $157.50 so far Unly 28 left! I've wrangled another cat and I have made $165,00 so far Only 19 left! I've wrangled another cat and I have made $172.5e so far Only 18 left! I've wrangled another cat and I have made $189.09 so far Only 17 left! I've wrangled another cat and I have made $187.50 so far Only 16 left! I've wrangled another cat and I have made 95.0so far Only 15 leftl I've wrangled another cat and I have made $282.50 so far Only 14 left! I've wrangled another cat and I have made $210.00 so far Only 13 left! I've wrangled another cat and I have made $217.59 so far Only 12 left! L've wrangled another cat and I have made $225.0 so far Only 11 leftl I've wrangled another cat and I have made $232.5 so far Only 1 left! I've wrangled another cat and I have made $240.0 so far Only 9 1eft! I've wrangled another cat and I have made $247.5 so far Only 8 leftl I've wrangled another cat and I have made $255.8 so far Only 7 left! I've wrangled another cat and I have made $262.50 so far Only 6 left! I've been fired Someone else will have to wrangle the rest! Press any key to continue I have made $129.98 so farStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started