عرض مشاركة واحدة
منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 25-12-2011, 08:10 PM   #388

miss soom

جامعي

الصورة الرمزية miss soom

 
تاريخ التسجيل: Sep 2011
نوع الدراسة: إنتظام
المستوى: الرابع
الجنس: أنثى
المشاركات: 11
افتراضي رد: Cpcs 202 شروحات وحلول وواجبات الجافا

هذا الكود كامل وأمري للهـ لأني تعبت وأنا أحاول نقرتين لعرض الصورة في صفحة مستقلة

كود PHP:
package finle.project;
import java.util.Arrays;
import javax.swing.JOptionPane;
import java.util.Scanner;

public class 
FinleProject
{
int size,arr;
Scanner input = new Scanner(System.in);
    {
    
JOptionPane.showMessageDialog(null,"wellcme to my program\n"
     
" to help small compny \n" "to test thier product");
   
FinleProject number = new FinleProject();
     
number.showDialog();
     
     
int s;
      
String aa=JOptionPane.showInputDialog(null," 1 :to calculate total "
              
"\n 2 :to calculate maximum "
              
"\n 3 :to calculate minmum "
              
"\n 4 :to exit");
      
s=Integer.parseInt(aa);
      while (
s!=4){
          if (
s==1)
              
total(number);
          if (
s==2)
              
maximum(number );
          if (
s==3)
              
manimum(number);
          else 
              
JOptionPane.showMessageDialog(null,"thanks for  use this programm");
           
aa=JOptionPane.showInputDialog(null," 1 :to calculate total "
              
"\n 2 :to calculate maximum "
              
"\n 3 :to calculate minmum "
              
"\n 4 :to exit");
      
s=Integer.parseInt(aa);}  
  }
public 
void showDialog(){
    
size =  new Integer(JOptionPane.showInputDialog("Enter number of month you "
            
"\n use to test your product:"));
  
size();
}
public 
void size()
{
arr size;
int []  number = new int[arr];
System.out.println("The number of month IS "+arr);
for(
int index=0;index<arr;index++)
 {
   
System.out.print("Enter number of product in" size +" months by press ENTER");
    
number[index]=input.nextInt();
 }
}
public static 
int total (int[] number)
{
int  tot=0;
for (
int arr:number)
    
tot+=arr;
System.out.printf("total of product is : %d\n",tot);
return 
tot;
    
}

    public static 
int maximum int[] number )
    {
        
int max number[0];
        for (
int c=1cnumber.lengthc++)
        {   if (
maxnumber[c])
                
max=number[c];
        }
        return 
max;
    }
    public static 
int manimum int[] number )
    {
        
int main number[0];
        for (
int c=1cnumber.lengthc++)
        {   if (
main number[c])
                
main=number[c];
        }
        return 
main;
    } 


 

توقيع miss soom  

 

لسْتٌ كَآملة ولكِّنـيْ: تَربيّتٌ عَلـﮱ يَدِ إِمرَٱةٍ يَصمتٌ ٱلكَـونٌ. » لِرَوْعتِہآ نقرتين لعرض الصورة في صفحة مستقلة ♥♥ !

.ماأجمل ان تعيش على الارض
.. تأكل .. وتنام ..والله ينادي بأسمك
في السماء( اني احب فلانا فأحبوه )نقرتين لعرض الصورة في صفحة مستقلة

 

miss soom غير متواجد حالياً   رد مع اقتباس