InstagramTwitterSnapChat


 
وصف

العودة   منتديات سكاو > الكليات الجامعية > منتدى كلية الحاسبات وتقنية المعلومات > المنتدى العام لكلية الحاسبات وتقنية المعلومات
التسجيل مشاركات اليوم البحث
   
   


المنتدى العام لكلية الحاسبات وتقنية المعلومات قسم خاص بالمواد العامة و الطلاب غير المتخصصين بكلية الحاسبات وتقنية المعلومات

مساعدة في برمجة cpcs202

المنتدى العام لكلية الحاسبات وتقنية المعلومات

 
 
أدوات الموضوع إبحث في الموضوع انواع عرض الموضوع
منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 30-11-2014, 02:25 PM   #2

Turki 7bb

جامعي

الصورة الرمزية Turki 7bb

 
تاريخ التسجيل: May 2014
كلية: كلية الحاسبات وتقنية المعلومات
نوع الدراسة: إنتظام
المستوى: الأول
البلد: جــــدة
الجنس: ذكر
المشاركات: 24
افتراضي رد: مساعدة في برمجة cpcs202

كود:
boolean run = true ;
        while (run) {
        System.out.println("Calculator Program");
        System.out.println("=============================================");
        System.out.println("1. For additon of two numbers"+"\t"+"Press 1");
        System.out.println("2. For additon of two numbers"+"\t"+"Press 2");
        System.out.println("3. For additon of two numbers"+"\t"+"Press 3");
        System.out.println("4. For additon of two numbers"+"\t"+"Press 4");
        System.out.println("5. For additon of two numbers"+"\t"+"Press 5");
        System.out.println("6. For additon of two numbers"+"\t"+"Press 0");
        System.out.println("=============================================");
        
        Scanner i = new Scanner (System.in);
        System.out.print("Enter Your choice: ");
        int x = i.nextInt();
        if (x==1)
        System.out.println("Calculator Program - addition of two numbers");  
        
        else if (x==2)
        System.out.println("Calculator Program - addition of two numbers");   
        
        else if (x==3)
        System.out.println("Calculator Program - addition of two numbers");    
        
        else if (x==4)
         System.out.println("Calculator Program - addition of two numbers");   

        else if (x==5)
         System.out.println("Calculator Program - addition of two numbers");   
        
        else {
            
        }
        System.out.println("=============================================");
        System.out.print("Enter the first number: ");
        double n1 = i.nextInt();
        System.out.print("Enter the second number: ");
        double n2 = i.nextInt();
        
        double n3 ;
        
        if (x==1){
            n3 = n2+n1;
        System.out.println("additon of "+n1+" and "+n2+" is "+n3);  
        }
        else if (x==2){
            n3 = n2-n1;
        System.out.println("additon of "+n1+" and "+n2+" is "+n3);  
        }  
        
        else if (x==3){
            n3 = n2*n1;
        System.out.println("additon of "+n1+" and "+n2+" is "+n3);  
        }    
        
        else if (x==4){
            n3 = n2/n1;
        System.out.println("additon of "+n1+" and "+n2+" is "+n3);  
        }   

        else if (x==5){
            n3 = n2%n1;
        System.out.println("additon of "+n1+" and "+n2+" is "+n3);  
        }   
        
        else {
            
        }
        System.out.println("Do you want to continue ? ");
        System.out.println("Press 1 to continue");
        System.out.println("Press 0 to finish the program");
        System.out.println("=============================================");
        System.out.print("Enter Your choice: ");
        int y = i.nextInt();
        
        if (y==1)
            run = true ;
        else if (y==0)
            run = false ;
سويتو ع السريع واوامر سهله بدون مثود او مصفوفات ويوجد بعض الاخطاء الاملائية للطباعة للوقت ههههه :) بالتوفيق

 

Turki 7bb غير متواجد حالياً   رد مع اقتباس
 

 


تعليمات المشاركة
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

BB code is متاحة
كود [IMG] متاحة
كود HTML معطلة

الانتقال السريع

 


الساعة الآن 06:57 AM


Powered by vBulletin® Version 3.8.9 Beta 3
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Ads Organizer 3.0.3 by Analytics - Distance Education

أن كل ما ينشر في المنتدى لا يمثل رأي الإدارة وانما يمثل رأي أصحابها

جميع الحقوق محفوظة لشبكة سكاو

2003-2025