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
What is the value of y when this code executes?
Cerrena [4.2K]

Answer:

The operation of 6*x only executes if x is greater or equal to 0, since x=-10 and -10 is less than 0, the operation does not execute. For this reason,  the value of y using this code is None.

Explanation:

In python a function is defined with the syntaxis:  

def function(x):  

the operation to execute (x)

value to return

In this case, the function is foo and the parameter is x:  

def foo(x):

  if x>= 0:

     return 6*x

The code starts by assigning a value to x. Then, the code asks if the value of x is grater or equal to 0, if this condition is meet, then the code returns the value of 6 times x, if not, then the code does not return a value. In this case, x is -10 and this value is not grater or equal to 0. Given that the condition is not met, then the code stops executing and the value of y is none.

4 0
2 years ago
The choice of database does not have any impact on the relevancy of search results?
Nookie1986 [14]

Answer:

When searching for articles using library databases, the following tips should increase the relevance of your results. Quotation marks around two or more keywords - phrase searching - ensures that the results will include the exact phrase.

Explanation:

8 0
2 years ago
________ use statistics to anticipate customers withdrawals. ________ use statistic to calculate probable life expectancy to hel
Fudgin [204]

Answer:

Banks

Insurance companies

Explanation:

3 0
2 years ago
In order to look up ipv4 and ipv6 dhcp leases, what two files should be viewed?​
Zigmanuir [339]
The answers are  /var/lib/dhcpd/dhcpd.leases   &                                                                       /var/lib/dhcpd/dhcpd6.leases
In order to look up ipv4 and ipv6 dhcp leases, The two files that should be viewed are  /var/lib/dhcpd/dhcpd.leases &  /var/lib/dhcpd/dhcpd6.leases                                             
7 0
2 years ago
The domain in an email message tells you the
bezimeni [28]
The question is asking to choose among the following choices that state what would the domain in an email represents, base on my research, I would say that the answer would be letter B. location of the destination. I hope you are satisfied with my answer and feel free to ask for more 
8 0
3 years ago
Other questions:
  • In this code, identify the repeated pattern and replace it with a function called month_days, that receives the name of the mont
    14·1 answer
  • __________%of the users have left websites in frustration due to poor navigation.
    13·1 answer
  • When might be the best time to start saving for retirement?
    5·2 answers
  • Suppose end system A wants to send a large file to end system B. At a very high level, describe how end system A creates packets
    7·1 answer
  • Write a statement that outputs variable numObjects. End with a newline.
    6·1 answer
  • Which of the following tools enables a production mixer to sync audio and video?
    7·1 answer
  • HELP AASAP BRAINLIEST JUST HELP
    13·1 answer
  • Lesson 2.7 Code Practice #2
    13·1 answer
  • (lesson 7.9: acceptance-rejection --- continuous examples.) consider the constant . on average, how many iterations (trials) wil
    6·1 answer
  • Identify the end-to-end processes that should appear in the process landscape model.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!