2
Answers

denotes a 'class' which is not valid in the given context???

_hristo_

_hristo_

19y
7.3k
1
Hi! First post from a newbie! :-) So what is wrong? What does it really mean? denotes a 'class' which is not valid in the given context Posts my code below (in some in swedish): ****************************************** using System; namespace Upp1 { /// /// Summary description for Class1. /// public class Class1 { public Class1() { Upp1.Procentcalc(); } } } ************************************************ using System; namespace Upp1 { /// /// Summary description for Class1. /// public class Procentcalc { string Belopp=""; string Procent=""; double dBelopp=0; double dProcent=0; double Resultat=0; [STAThread] private void Main() { System.Console.WriteLine("Mata in ett belopp"); Belopp =System.Console.ReadLine(); System.Console.WriteLine("Mata in procentsatsen"); Procent =System.Console.ReadLine(); dBelopp=Convert.ToDouble(Belopp); dProcent=Convert.ToDouble(Procent); Resultat=(dBelopp/100)*dProcent; Console.Write(Procent + " procent av " +Belopp + " är " +Resultat); } } } ********************************************************* Does it make any sense?
Answers (2)
0
mibuyt

mibuyt

NA 512 0 19y
Hi, I really doubt you can get Class1 to run properly! Why you want to do this way? Cheers.
0
shimtanny

shimtanny

NA 440 0 19y
Hi The following code is useless. Also, i would remove the whole Class1. public Class1() { Upp1.Procentcalc(); } If anyway wann't to do so, instantiate your Procentcalc with the keyword "new", like this: new Upp1.Procentcalc(); Simon
Next Recommended Forum