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
How can development in ICT be utilized to speed up the development and integration efforts
valina [46]

Answer:

Research question 1:

How do exposure to and use of ICTs in school affect future employment?

The impact of ICT use in school and student exposure to ICTs, and the nature of use and exposure, on student employability in developing has not been well documented. Tracer studies of the impact of ICTs on further study and employment would be useful, as this could be a useful additional measure of educational quality, beyond standardized testing results.

Research question 2:

What is the impact of ‘computer-literacy’ instruction in schools?

In most circumstances in LDC schools, ICTs are used almost exclusively to provide instruction in “computer literacy’. Emerging research from OECD experience suggests such instruction may not be a productive use of time or resources – is this true in LDCs?

Research question 3:

What is the gender impact of ICTs in education on access, use of, attitudes toward, and learning outcomes?

Studies of the potential differential impact of ICT use by gender on student access to learning in a variety of LDC contexts need to be done.

Research question 4:

How can ICTs be used to present, comment on and discuss student work, and what are the implications of such impact?

The effects of using ICTs to present and discuss student work are not well researched.

Research question 5:

Are some school subjects better suited for ICT integration than others?

Given that access to ICTs in schools is quite limited, it would be useful to know if certain ICT applications are better suited to use in certain school subjects and others and, if so, how ICTs can be utilized to aid teaching and learning in such subjects.

Explanation:

6 0
3 years ago
What cell address indicates the intersection of the first row and the first column in a worksheet?
Roman55 [17]
The answer is A1. 

The columns are arranged alphabetically, and the rows are ordered numerically. The cell address states the column, a letter, followed by the row, a number. The first cell address, the top-left cell of the sheet, is A1
7 0
3 years ago
Read 2 more answers
List the various cases where use of a NULL value would be appropriate.
melomori [17]

Answer:

The answer is below

Explanation:

There are cases where the use of a NULL value would be appropriate in a computer programming situation. These cases can be summarily described below:

The first case is in a situation where the value of the attribute of a certain element is known to exist, but the value can not be found

The second case is in a situation where the value of the attribute of a certain element is not known whether it exists or not.

4 0
3 years ago
Which sentence is true about artificial neural networks
kirill [66]

Answer:

Oct 30, 2018 — ... design? A) difficulty level B) level duration C) perspective D) player-adjusted time. ... Add answer+5 pts. Log in to add comment. jonathanwilson is waiting for your help. Add your answer and earn points. ... New questions in Computer Science. answer ... classified the computer on the basic of operations​.Explanation:

8 0
3 years ago
The internet is an accurate and reliable source of information and an investigator should take the information at face value. tr
AVprozaik [17]
False

Not everything is true, face value is not always reliable
7 0
3 years ago
Other questions:
  • Questions 6 - 9 Refer to the following code: public class WhatsIt { private int[] values; private double average; public WhatsIt
    7·1 answer
  • What is an example of asynchronous communication
    7·1 answer
  • An is auditor reviewing a network log discovers that an employee ran elevated commands on his/her pc by invoking the task schedu
    10·1 answer
  • What was the ENIAC computer and how was it used/what for?
    9·1 answer
  • The computer output for integer programs in the textbook does not include reduced costs, dual values, or sensitivity ranges beca
    14·1 answer
  • Write a static method named contains that accepts two arrays of integers a1 and a2 as
    14·1 answer
  • Which picture should i put as my profile picture.
    15·2 answers
  • Insertion point shows where the typed text will appear.
    5·1 answer
  • How can i setup a mesage room and also want to hangout ??????
    10·1 answer
  • Which factor affects reading speed the most?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!