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
An application team plans to follow the 10-phase SDLC model. After the team identifies both functionality and security requireme
Valentin [98]

Answer:

The team did not adequately formalize the software's design

Explanation:

The most logical reason for this confusion is the fact that the team did not adequately formalize the the software design.

The design approach has to do with clearly defining the architectural modules of the application. The requirements in the software requirement specification document would serve as input for the next phase. The documents are prepared and they give a definition of the overall system architecture.

The team got confused because they did not go through this phase of the 10-phase SDLC model.

3 0
3 years ago
Which section of a personal narritive requires the most development?
Naily [24]
A characters introduction because a personal narrative is a thing written about a person/charector
4 0
3 years ago
A yellow inspection tag on a scaffold means the scaffold has been inspected and
kodGreya [7K]

Answer:CAUTION

Explanation: on edg

7 0
3 years ago
Semiconductor memory is used mainly for primary storage even with its high cost. In another hand, the magnetic tape is the cheap
Charra [1.4K]
<span>Storage costs of magnetic tape are much lower than semiconductor storage (chip storage), but they take longer to access because they are not on-board the system and have to be added manually. Chip memory, on the other hand, can be used as primary storage for a system even with a higher cost because it's typically directly connected to the system board and is much more easily accessible by the system.</span>
8 0
3 years ago
Write an if/else statement that assigns 1 to the variable fever if the variable temperature is greater than 98.6; otherwise it a
klio [65]

Answer:

temperature = int(float(input("Enter temperature: ")))

fever = 0

if temperature > 98.6:

   fever +=1

else:

   fever = 0

print(fever)

Explanation:

3 0
2 years ago
Other questions:
  • Derek found that the CPU was running several processes. While Derek was looking at Task Manager, the computer crashed. Derek res
    15·2 answers
  • Benjamin recently issued new mobile phones to the marketing team at his company. Each phone can transmit encrypted information f
    8·1 answer
  • Computer design replaced ______________
    6·1 answer
  • If not cleared out, log files can eventually consume a large amount of data, sometimes filling a drive to its capacity. If the l
    10·2 answers
  • If String str = "Computer Science";, then what is the value of str.substring(10);? ​
    6·1 answer
  • A hacker using information gathered from sniffing network traffic uses your banking credentials from a recent transaction to cre
    6·1 answer
  • When using MakeCode Arcade, what is the easiest way to make modules?
    6·1 answer
  • There are two main types of hard drive available to a computer. State what they are and describe their use.
    5·1 answer
  • While working in a group of two the members are not getting along. You bring the two members together so they can discuss this i
    11·1 answer
  • Under which menu would you be able to see the number of continuous track minutes available on each mounted hard drive at the cur
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!