1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Paladinen [302]
3 years ago
5

The program DebugTwo2.cs has syntax and/or logical errors. Determine the problem(s) and fix the program.// This program greets t

he user// and multiplies two entered valuesusing System;using static System.Console;class DebugTwo2{static void main(){string name;string firstString, secondSting;int first, second, product;Write("Enter your name >> );name = ReadLine;Write("Hello, {0}! Enter an integer >> ", name);firstString = ReadLine();first = ConvertToInt32(firstString);Write("Enter another integer >> ");secondString = Readline();second = Convert.ToInt(secondString);product = first * second;WriteLine("Thank you, {1}. The product of {2} and {3} is {4}", name, first, second, product);}}
Computers and Technology
1 answer:
Elenna [48]3 years ago
5 0

Answer:

The corrected code is as follows:

using System;

using static System.Console;

class DebugTwo2{

     static void Main(string[] args){

       string name;string firstString, secondString;

       int first, second, product;

       Write("Enter your name >> ");

       name = ReadLine();

       Write("Hello, {0}! Enter an integer >> ", name);

       firstString = ReadLine();

       first = Convert.ToInt32(firstString);

       Write("Enter another integer >> ");

       secondString = ReadLine();

       second = Convert.ToInt32(secondString);

       product = first * second;

       Write("Thank you, {0}. The product of {1} and {2} is {3}", name,first, second, product);

   }

}

Explanation:

       string name;string firstString, secondString; ----- Replace secondSting with secondString,

<em>        int first, second, product;</em>

       Write("Enter your name >> "); --- Here, the quotes must be closed with corresponding quotes "

       name = ReadLine(); The syntax of readLine is incorrect without the () brackets

<em>        Write("Hello, {0}! Enter an integer >> ", name);</em>

<em>        firstString = ReadLine();</em>

       first = Convert.ToInt32(firstString); There is a dot between Convert and ToInt32

<em>        Write("Enter another integer >> ");</em>

       secondString = ReadLine(); --- Readline() should be written as ReadLine()

<em>        second = Convert.ToInt32(secondString);</em>

<em>        product = first * second;</em>

       Write("Thank you, {0}. The product of {1} and {2} is {3}", name,first, second, product); --- The formats in {} should start from 0 because 0 has already been initialized for variable name

   }

}

You might be interested in
SOMEONE HELP ME!!!!!
Oliga [24]

Answer:

I don't see the question

Explanation:

5 0
2 years ago
Algorithm and flowchart:- find the product of two number (a and b)​
Korvikt [17]

Answer:

i have no idea a i guess

Explanation:

5 0
2 years ago
What is a specific challenge faced by information visualization researchers who are building an interface?
Mkey [24]

Answer:

 Information virtualization is the process of representing the abstract data such as numeral number and text into the form of visual which is human can easily understand.

The main challenges faced by the information visualization researchers are:

  • The main challenge which are faced by the information virtualization is during the data importing and also cleaning in the system.
  • It also not able to access the large amount of the data easily from the system.
  • Due to the poor selection of the scale and the coordinate rotation it also lead to the data distortion.
3 0
3 years ago
The readline method reads text until an end of line symbol is encountered, how is an end of line character represented
zhannawk [14.2K]

Answer:

\n

Explanation:

readline() method is used to read one line from a file. It returns that line from the file.    

This line from the file is returned as a string. This string contains a \n at the end which is called a new line character.

So the readline method reads text until an end of line symbol is encountered, and this end of line character is represented by \n.

For example if the file "abc.txt" contains the lines:

Welcome to abc file.

This file is for demonstrating how read line works.

Consider the following code:

f = open("abc.txt", "r")  #opens the file in read mode

print(f.readline()) # read one line from file and displays it

The output is:

Welcome to abc file.    

The readline() method reads one line and the print method displays that line.                        

3 0
3 years ago
The primary input device for interacting with the operating system is the ____.
andre [41]
The primary input device is the Mouse.
3 0
2 years ago
Read 2 more answers
Other questions:
  • Which of these statements regarding mobile games is true? A. They are typically played indoors. B. They have detailed environmen
    7·1 answer
  • In the ____________________ technique, the virus is divided into several parts and the parts are placed at random positions thro
    7·1 answer
  • Give a pseudo-code description of the O(n)-time algorithm for computing the power function p(x,n).Also draw the trace of computi
    5·1 answer
  • Which is most harmful computer virus define​
    15·1 answer
  • What are the data types used in C programming with examples
    5·1 answer
  • A group of students want to create an educational online game for computer laboratory in their school which type of network will
    6·1 answer
  • 1) Prompt the user to enter two words and a number, storing each into separate variables. Then, output those three values on a s
    11·1 answer
  • Chen needs to configure a filter on the current folder and would like to filter by the sender of a message. Which tab in the Fil
    7·2 answers
  • How come I haven't moved to the next rank even though I have all of the right things to move on?
    10·2 answers
  • What happen if there is no authentication??
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!