🔒 Closed Pahelp po saan Mali dito?

Status
Not open for further replies.
Ano po mali dito ?

Gagayahin kasi namin tong sa pic.
IMG_20211109_115708.webp


C#:
class Program
{
          
          static void Main(string[ ] args)
          {
          double firstnum;
          double secondnum;
          double answer;
          string ops;
          
                Console.Writeline("Enter num1:");   
                 firstnum = Double.parse(Console.ReadLine());
      
                
                 Console.Writeline("Enter your desired operator: {+}, {-}, {*}, {/} ");   
                 ops = Console.ReadLine();
                 Console.Readkey();

                  Console.Writeline("Enter num2:");   
                 firstnum = Double.parse(Console.ReadLine());
                
                 if(ops == "+")
                 {
                  asnwer = firstnum + secondnum;
                  Console.Write(answer);
                 }
                 if(ops == "-")
                 {
                  asnwer = firstnum - secondnum;
                  Console.Write(answer);
                 }
                 if(ops == "*")
                 {
                  asnwer = firstnum * secondnum;
                  Console.Write(answer);
                 }
                 if(ops == "/")
                 {
                  asnwer = firstnum / secondnum;
                  Console.Write(answer);
                 }
                  Console.ReadKey();
  
          
         }

     }

}
 

Attachments

  • Screenshot_2021-11-09-11-53-16-12.webp
    Screenshot_2021-11-09-11-53-16-12.webp
    67.3 KB · Views: 15
  • Screenshot_2021-11-09-11-53-16-12.webp
    Screenshot_2021-11-09-11-53-16-12.webp
    67.3 KB · Views: 14
Dami pala error dyan eto ok na Haha
Pa mark as solutionYou do not have permission to view the full content of this post. Log in or register now. naman para hindi sayang effort ko, salamat


C#:
 class Program
    {
        static void Main(string[] args)
        {
            double firstnum;
            double secondnum;
            double answer;
            string ops;

            Console.WriteLine("Enter num1:");
            firstnum = Double.Parse(Console.ReadLine());

            Console.WriteLine("Enter num2:");
            secondnum = Double.Parse(Console.ReadLine());

            Console.WriteLine("Enter your desired operator: {+}, {-}, {*}, {/} ");
            ops = Console.ReadLine();


            if (ops == "+")
            {
                answer = firstnum + secondnum;
                Console.WriteLine(" The sum of " + firstnum + " and " + secondnum + " is " + answer);
            }
            else if (ops == "-")
            {
                answer = firstnum - secondnum;
                Console.WriteLine(" The sum of " + firstnum + " and " + secondnum + " is " + answer);
            }
           else if (ops == "*")
            {
                answer = firstnum * secondnum;
                Console.WriteLine(" The sum of " + firstnum + " and " + secondnum + " is " + answer);
            }
           else
            {
                answer = firstnum / secondnum;
                Console.WriteLine(" The sum of " + firstnum + " and " + secondnum + " is " + answer);
            }
            Console.ReadKey();

        }

    }


phcbryan16.webp

phcbryan.webp

phcbryan1.webp
 
try to review your code ts. make sure na na declare mo yung mga variables na ginagamit mo. example "asnwer" na ginamit mo to store the result of mathematical operation is hindi pareho yung na declare mo sa itaas is "double answer". syntactically incorrect/wrong spelling nalang para madali. parang ganito.ts pinangalanan mo aso mo ng brownie pero tawag mo brown. sa programming ts sensitive po ito kung ano tawag mo sa variables mo during declaration mo dapat pag tinawag mo na within the program dapat same din ang spelling. kuha mo ts? kaw nga nagagalit pag mali tawag sayo ng prof mo. tapos sasabihin mo sir/mam mali ho yan ito po yung pangalan ko, ganyan din sa programming ts. apaka sensitive nito..
 
Status
Not open for further replies.

About this Thread

  • 14
    Replies
  • 675
    Views
  • 7
    Participants
Last reply from:
jokerger25

Online now

Members online
1,056
Guests online
994
Total visitors
2,050

Forum statistics

Threads
2,277,032
Posts
28,973,829
Members
1,229,693
Latest member
riogab
Back
Top