Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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 far

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle9i Database Administrator Implementation And Administration

Authors: Carol McCullough-Dieter

1st Edition

0619159006, 978-0619159009

More Books

Students also viewed these Databases questions

Question

4. Devise an interview strategy from the interviewers point of view

Answered: 1 week ago