C# Programming:
DebugNine2
The provided file has syntax and/or logical errors. Determine the problem(s) and fix the program.
![+DebugNine2.cs Instructions Build Output The provided file has syntax and/or logical errors. Determine the problem(s) and fix the program. 1/ Creates a Breakfast class 2 // and instantiates an object 3// Displays Breakfast special information 4 using static System.Console; Conpilation fatled: 2 error(s), 8 warnings DebugNine2.cs(9,61): error C$1810: Newline in constant DebugNine2.cs (11,6): error CS1525: Unexpected synbol Writeltne class DebugNine2 7static void MainC) GRADING As you complete the steps above, you can use the Test button to check if the lab tests are passing. Once you are satisfied with the results, use the Grade button to save your score Breakfast special new Breakfast( French toast, 4.99); //Display the info about breakfast WriteLine (special.INF0); // then display todays special WriteLine( Today we are having [1] for [1 10 Test Case FAILED: Program produces correct output 12 13 14 15 16 17 class Breakfast 18 19 public string INFO 20 21 I Breakfast constructor requires a 22 II name, e.g French toast, and a price 23 public Breakfast(string name, double price) 24 25 26 27 8 public string Nane [get; set;] 29 public double Price [get; set;2 30 special.Nane, special.Price. ToString(C2)): Unit Test FAILED: Fixed bug(s) in Breakfast class Issues Breakfast is the most inportant meal of the day.; CS1525: Unexpected symbol WriteLIne DebugNine2.cs File: Line: Hint: Name· name ; Price price; The compiler detected an invalid character in an expression. CS1010: Newline in constant File: Line: DebugNine2.cs 9 Run Code Test Grade](http://img.homeworklib.com/questions/5fd818c0-b84b-11eb-a4a7-c97d011be51f.png?x-oss-process=image/resize,w_560)

Screenshot of the modified code:

Sample output:

Code to copy:
// Creates a Breakfast class
// and instantiates an object
// Displays Breakfast special information
using static System.Console;
class DebugNine2
{
static void Main()
{
//syntax error: quote is missing
Breakfast special = new Breakfast("French toast", 4.99);
//Display the info about breakfast
WriteLine(special.INFO);
// then display today's special
//logical error: {0} and syntax error: special.Name
WriteLine("Today we are having {0} for {1}",
special.Name, special.Price.ToString("C2"));
}
}
class Breakfast
{
public string INFO =
"Breakfast is the most important meal of the day.";
// Breakfast constructor requires a
// name, e.g "French toast", and a price
public Breakfast(string name, double price)
{
Name = name;
Price = price;
}
public string Name { get; set; }
public double Price { get; set; }
}
C# Programming: DebugNine2 The provided file has syntax and/or logical errors. Determine the problem(s) and fix...
The following file has syntax and/or logical errors. In each case, determine the problem, and fix the program. using System; using static System.Console; using System.IO; class DebugFourteen1 { static void Main() { string fileName; string directory; string path; string files; int x; Write("Enter a directory: "); directory = ReadLine(); if(Directory.Exists(Directory)) { files = Directory.GetFiles(directory); if(files.Length = 0) WriteLine("There are no files in " + directory); else { WriteLine(directory + " contains the following files"); for(x = 0; x <= files.Length;...
The following file has syntax and/or logical errors. Determine the problem and fix the program. // Handles a Format Exception if user does not enter a number using System; using static Syst0em.Console; class DebugEleven1 { static void Main() { double salary; string salVal; bool isValidSalary; while(!isValidSalary) { try Write("Enter an employee's salary "); salVal = ReadLine(); salary = Convert.ToDouble(salVal); isValidSalary = true; catch(Formatexception fe) { WriteLine("You must enter a number for the salary."); } } WriteLine("The salary {0} is valid",...
The files provided contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly. import java.util.*; public class DebugEight1 { public static void main(String args[]) { Scanner input = new Scanner(System.in); char userCode; String entry, message; boolean found = false; char[] okayCodes = {'A''C''T''H'}; StringBuffer prompt = new StringBuffer("Enter shipping code for this delivery\nValid codes are: "); for(int x = 0; x <...
Write a program that will check a Java file for syntax errors. The program will ask for an input-file name and output-file name and will then copy all the code from the Java input file to the Java output file, but with the following changes: 1. Any syntax error found in the Java input file will be corrected: a. Missing semicolon b. Missing compound statements (curly braces) c. All comments have to start with // and end with a period....
Help In C# CHECKS: Program outputs score before and after bonus Method GiveBonus is overloaded Output: It has to look exactly like that Output Scores was 82.Now it is 5. Grade was B Now it is + --------------------------------------------------------------------- DebugEight2.cs has syntax and/or logical errors. Determine the problem(s), and fix the program. CODE: // Overloaded method gives bonus points // whether grade is a number or letter using static System.Console; class DebugEight2 { static void Main() { int numericScore = 82;...
The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly. Note: DebugDataOne1.txt and DebugDataOne2.txt do not need to be edited. They are used by the program. import java.nio.file.*; import java.nio.file.attribute.*; import java.io.IOException; public class DebugThirteen1 { public static void main(String[] args) { Path file1 = Paths.get("/root/sandbox/DebugDataOne1.txt"); // path to file DebugDataOne1.txt in...
Prelab Exercises Your task is to write a Java program that will print out the following message (including the row of equal marks): Computer Science, Yes!!!! ========================= An outline of the program is below. Complete it as follows: a. In the documentation at the top, fill in the name of the file the program would be saved in and a brief description of what the program does. b. Add the code for the main method to do the printing. //...
Correct the five syntax, run-time or logic errors that are found in the CountAndAverageNumbers.java file. Link to the file: CountAndAverageNumbers.javaPreview the document. Make sure you include comments in your code where errors were corrected. If you do not flag each error with a comment, points will be deducted. Upload the corrected .java file here. The output of the corrected file looks like the following: Debug4Output.PNG This program reads an unspecified number of integers, determines how many positive and negative values...
Hi please help with c++ programming.
This is my code. there's a syntax error. PLEASE FIX MY CODE
instead of re-designing the program.
Thanks
/*
Description of problem:
Introduction to Friends functions.
Create objects in the stack (not on the heap)
3.1: Add a friend function, kilotopound, which will convert
kilograms to pounds.
3.2: Add a copy constructor utilizing Lab 3.1 code.
Copy the fist object using a copy constructor. Output the contents
of both objects.
*/
#include <iostream>...
Java Programming The following is about creating a class Fish and testing it. In every part, correct any syntax errors indicated by NetBeans until no such error messages. (i) Create a class Fish with the attributes name and price. The attributes are used to store the name and the price of the fish respectively. Choose suitable types for them. You can copy the class Counter on p.17 of the unit and modify the content. Copy the content of the file...