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
I NEED SOME MAJOR HELP W/ THIS!!! PLSSS. WHOEVER HELPS GETS 80 POINTS!!! I NEED IT DONE SOON! TYY <3;)
Oksanka [162]

Answer:

I probably won't awnser them all but I'll try my best

Explanation:

Hacking is a breach of privacy online usually caused by some kind of malware injected into your device there's multiple types of this program or files malware which simply damages and harms your device. A Trojan horse is a program which tricks you by selling you a fake product which has code in it which has code which gives the hacker remote access to your device this program is usually free and masked like a crack or patch of a certain program. U got the second an third question with this one so u can just divide it into pieces. Piracy is Hacking but this time the hacker is stealing ur information through the malware. Invasion of privacy can have multiple forms online and offline. Online intrusion is when a service gives out information you entrust to it while off line Intrusion is stalking trespassing blackmail etc.

4 0
3 years ago
How do you write 124.59 in expanded form?
scZoUnD [109]
124.59 in expanded form is:

100 + 20 + 4 + 0.5 + 0.09
8 0
3 years ago
Read 2 more answers
Write a program and flowchart. The program should ask the user for the average temperature in each of the last 12 months. After
Afina-wow [57]

#First we define the variables to house the temperatures

#temp is an empty array that will be used to store the temperature

Temp = []

#The months is defined as stated below

months = 12

#Ask the user for the temperature input and unit if possible

print("Kindly enter the temperature here")

#the program enter loop to get the temperatures.

for x in range(months):  

   InitTemp = str(input("Kindly add the unit behind the number .eg C for celcius"))

   Temp.append(InitTemp)

j=0

for x in range(len(Temp)):  

   j=j+1

   print("The Temperature is", " ", Temp[x], "for the ", j, "Month" )

#there is an attached photo for the flowchart

5 0
3 years ago
Give five examples of top level domain​
coldgirl [10]

Answer:  .com — Commercial businesses.

.org — Organizations (generally charitable).

.net — Network organizations.

.gov — U.S. government agencies.

.mil — Military.

.edu — Educational facilities, like universities.

Explanation:

5 0
3 years ago
Read 2 more answers
Is it possible to build a portal in real life?
san4es73 [151]

No because we are not that  far in technology.

3 0
3 years ago
Read 2 more answers
Other questions:
  • Explain why blocking ping (ICMP echo request) packets at an organization's edge router is not an effective defense against ping
    11·1 answer
  • How many unique ip addresses can be made in a fixed-length ip address system using 6 bits?
    8·1 answer
  • Controlled intersections use some form of which of the following:
    7·1 answer
  • A(n) _____ bus enables the central processing unit (CPU) to communicate with a system’s primary storage.
    5·1 answer
  • The color pattern in which marine organisms are light on the bottom and dark on the top of their bodies camouflaging them agains
    11·1 answer
  • shapes polymorphism Create a set of classes derived from an abstract class Shape, which provides a common interface, for managin
    7·1 answer
  • Suppose you're currently completing an examination online. When you're finished, you click on Reset Exam. Why would you do this?
    8·1 answer
  • True or false? Colons are required when entering the MAC address into the Reservation window?
    14·1 answer
  • Create a program which reads in CSV data of Creatures and loads them into aHash Map. The key of this hash map will be the name o
    10·1 answer
  • **HELP ME PLS**
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!