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]
2 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]2 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
6.5 Code Practice: Question 1
vaieri [72.5K]

Answer:

# input the number of temperatures required, which will be 10 here, but the user can print any number.

n=input("Enter the number of temperatures you want")

# create a list which can have n temperatures since it starts from 0, the maximum is n-1, and n needs to be converted to an integer.

temp= [0,int(n)-1]

#declared a variable of float type. As its 0.0 it will be a float, if 0 then integers, and so on

s=0.0

#running a for loop n times, and hence 0 to n-1.

for i in range(0, int(n)):

temp[i]=input("Enter the temperature in degree celsius in float")

s=s + float(temp[i])

i=i+1

print("The sum of the temperatures is:{0:0.1f}", +s)

Explanation:

The question from edhesive is: You need to write a program that calls for ten temperatures and then find the sum of temperatures. The temperature should be in float, which is expected. And the program is as being mentioned in the answer section.

4 0
3 years ago
Read 2 more answers
Using the notation exemplified in following question , list a set of tables and attributes (and identify keys) to represent the
Paha777 [63]

Answer:

Entities are - Students, CourseList, Advisor and CourseSelection.

Explanation:

The database is structure is designed using Crow Foot Database Notation as attached

6 0
2 years ago
Interpretations of the AICPA Code of Professional Conduct are dominated by the concept of: Question 4 options: 1) independence.
timama [110]

Answer: independence

Explanation:

The AICPA Code of professional Conduct is based on the following concepts which are :

1. responsibilities

2. serve the public interest

3. integrity

4. objectivity and independence

5. due care

6. The scope and nature of services.

3 0
2 years ago
Which of the following is an example of a Boolean operator?
miv72 [106K]

Answer:

C. But

Explanation:

Boolean operators are the operators that may have only two outputs which are True/False, On/Off and 1/0.

"But" can also be the example of Boolean operator. It is used in the meaning of "except" or "other than".

In Boolean operators "But" can be used as "AND" operator.

for example

<em>I am busy but I will go.</em>

In above example but is used as and which is combining two oposite statements. as

I am busy  and I will go.

Both statement oppose each other, so to make sense in English "But" is used.

7 0
2 years ago
Jeff has created a table to calculate the cost of raw materials that he purchases monthly. Cell A2 shows the fixed cost of the r
Luda [366]
=A2*D2
The above formula will allow calculation  of monthly cost of the first raw material.This is done by Multiplying the contents of cell A2 (Column A, Row 2) and cell D2 (Column D, Row 2). Here Cell A2 contains cost of the first raw material and Cell D2 contains number of units of the raw material produced  each month. After finding the monthly cost of the first raw material in this way, the monthly cost of other raw materials can simply be calculated by dragging down the formula to apply to the rows below.
3 0
3 years ago
Read 2 more answers
Other questions:
  • A technology _____ begins with the birth of a new technology and ends when that technology reaches its limits and dies as it is
    13·1 answer
  • What is meant by encapsulating semaphores? Bring out the need for it
    12·1 answer
  • Define a class, addresstype, that can store a street address, city, state, and zip code. use the appropriate functions to print
    11·1 answer
  • Suppose you are choosing between four different desktop computers: one is Apple MacIntosh and the other three are PC-compatible
    15·1 answer
  • Could I use a prepaid card to buy a Brainly membership because I tried to get the trial with a low balance but more than like 5$
    11·1 answer
  • Complete the statement below using the correct term.<br>Website managers use<br>every day​
    11·2 answers
  • Difference between a port and a connector
    10·1 answer
  • I need it in code please (python)
    15·2 answers
  • The three main objectives of information security are
    5·1 answer
  • What type of malware is best known for carrying other malware as a payload?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!