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
Travka [436]
3 years ago
8

Hello! I am a new coder, so this is a simple question. But I am trying to create a code where you enter a number, then another n

umber, and it divides then multiply the numbers. I put both numbers as a string, and as result when i tried to multiply/divide the numbers that were entered, an error occurred. How can i fix this?
using System;

namespace Percentage_of_a_number
{
class Program
{
static object Main(string[] args)
{
Console.WriteLine("Enter percentage here");
string Percentage = Console.ReadLine();


Console.WriteLine("Enter your number here");
string Number = Console.ReadLine();

String Result = Percentage / 100 * Number;


}
}
}
Computers and Technology
1 answer:
slavikrds [6]3 years ago
6 0

no longer returns an error but your math seems to have something wrong with it, always returns 0

Console.WriteLine("Enter a percentage here");

   int Percent = int.Parse(Console.ReadLine());

   Console.WriteLine("Enter your number here");

   int Number = int.Parse(Console.ReadLine());

   int result = Percent / 100 * Number;

You might be interested in
Given that ∠XQR = 180° and ∠LQM = 180°, which equation could be used to solve problems involving the relationships between ∠XQM
mr Goodwill [35]

C) 180 − (140 − 7a) = (70 − 3a)

Answer:

C) 180 − (140 − 7a) = (70 − 3a)

Explanation:

i got it wrong by clicking D on usatestprep

4 0
3 years ago
Disadvantages assembly level language for programming ​
Alisiya [41]
It takes a lot of time and effort to write the code for the same. It is very complex and difficult to understand. The syntax is difficult to remember. It has a lack of portability of program between different computer architectures.

Hope that helps
7 0
3 years ago
Read 2 more answers
45 points pls help
Artemon [7]

Answer:

Repetition.

Explanation:

hope it helps u

can u mark me as brainliest

8 0
3 years ago
Read 2 more answers
Declare a structure whose tag name is Server and that contains the following fields: manufacturer, a string, model and serialnum
NemiM [27]

Answer:

The answer to this question as follows :

Structure definition:

struct Server  //define structure server.

{

string manufacturer;

 //define string variable.

string model, serialnum;  //define string variable.

int year;

 //define integer variable.

double clockSpeed;

 //define double variable.

int cores;   //define integer variable.

int ram;

    //define integer variable.

int storage;

  //define integer variable.

};

Explanation:

Structure is a collection of heterogeneous(different type) elements. It is a user-define datatype which is available on the C/C++ programming language. To define any structure we use the struct keyword. The syntax of defining structure can be given as:

Syntax:

struct structure name

{

//define variables

//statements and code.

};

OR

struct structure name

{

//define variables

//statements and code.

}create structure variable;  

In the above structure code, we define a structure that is "Server". In this structure, we define different types of variables that is " manufacturer, model, serialnum, year, clockSpeed, cores, ram, and storage". In this structure variable manufacturer, model and serialnum datatype are a string and clockSpeed datatype is double and variable year, cores, ram, and storage data type is an integer.

3 0
3 years ago
By default, Outlook displays messages in the Content pane grouped by the
goldfiish [28.3K]

Answer:

By default, Outlook orders messages in the Content pane grouped by dates the messages were received and sorted with the oldest message at the top of the list.

Explanation:

8 0
2 years ago
Other questions:
  • When you declare an array, _____________________ You always reserve memory for it in the same statement You might reserve memory
    9·1 answer
  • Search the internet for news of a motor vehicle collision in your community involving drugs or alcohol. Keeping in mind that you
    8·1 answer
  • The INC and Dec instruction do not effect the__________ flag
    6·1 answer
  • 4. An advantage presented by straight-in spaces is that
    12·1 answer
  • ____ is the only automated disk-to-disk tool that allows you to copy data to a slightly smaller target drive than the original s
    5·1 answer
  • Que es un programa de ordenador?
    10·1 answer
  • To obtain the desired speedup, make sure your new function recursively calls itself no more than once in the body of the method.
    8·1 answer
  • Delete temp or %temp% files in Windows 10 is safe and, can it help boost up your PC fps?
    5·1 answer
  • Guys im getting the ps5 tomorrow :)​
    5·2 answers
  • In a paragraph discuss 5 steps of saving a document in a storage device.<br>​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!