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
Define a function below called increase_elements_by_x, which takes two arguments - a list of numbers and a single positive numbe
zubka84 [21]

Answer:

function

increase_elements_by_x (list, x)

{

 var tplist = [];

 for (i = 0; i < list.length; i++)

   {

     tplist[i] = list[i] + x;

   print (tplist[i])}

 return tplist;

}

var list =[1, 3, 5];

var copyList;

var x = 3;

copyList = increase_elements_by_x (list, x);

print (copyList);

Explanation:

Create a list named list with initial data 1,3,5.

Create a function name increase_elements_by_x  which takes list and number as argument.Create empty list tplist. Loop through list, for ever index add x to list[index] and save to an empty list tplist. After loop is exited return tplist.

create a variable copylist and set it to increase_elements_by_x. Value returned by increase_elements_by_x  will be saved in copylist. print copy list to see content of copy list.

5 0
4 years ago
"if you add text, delete text, or modify text on a page, word recalculates the location of automatic page breaks and adjusts the
Flura [38]

Answer:

The answer to this question is option (a).

Explanation:

In the computer, all the data will store in a file that can be text file, image file, etc. All the file store data into (binary language that is (0,1)). In Microsoft Word or any other word software, we add, delete or modify any text that stores in file.  The software adjusts text location, memory, and breaks the pages automatically.

 So the correct answer to this question is option (a).  

8 0
3 years ago
Read 2 more answers
Why does your e-learning course need a title slide?
aev [14]

Answer:

You've probably noticed that many e-learning courses start with a title slide. ... Your title slide is important because it's the first impression users get of your course—and learners do judge e-learning courses within moments of launching them! So take the opportunity to captivate them with a great-looking title slide.

5 0
3 years ago
Read 2 more answers
To save the changes to the layout of a table, click the Save button on the _____.
kari74 [83]
Quick access toolbar :)))))))))
7 0
3 years ago
list the six enternal parts or peripherals of a computer system and identify which are output and which are input devices?
inn [45]
There are many peripheral devices but heres 4 external output ones: monitor, speakers, plotter, and printer. Here are also 4 peripheral input devices: mouse, keyboard, mousepad, and joystick.
3 0
4 years ago
Read 2 more answers
Other questions:
  • A small company connects data acquisition equipment to the serial port of a computer. The equipment user has reported that not a
    8·1 answer
  • To become a news anchor, you should get a Bachelor's degree in:
    11·2 answers
  • Which AWS service is a managed service that makes it easy to set up, operate, and scale a relational database in the cloud?​
    9·1 answer
  • I only want someones opinion on this not anything you would find in a book.
    7·1 answer
  • To computer the equivalent units of production, add: A. units completed plus a percentage of the beginning WIP units B. units co
    10·1 answer
  • What is different between attaching a file on an email program versus a smartphone?
    12·2 answers
  • Which statement about comments is false? Select one: a. Lengthy comments can cause poor execution-time performance. b. Comments
    7·1 answer
  • William would like to sort a list of items after the data is already entered.
    5·1 answer
  • The question of ________ arises when considering the way in which online marketers gather consumers’ information over the Intern
    6·1 answer
  • Assume that the variable data refers to the list [5, 3, 7]. Write the expressions that perform the following tasks: a. Replace t
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!