InstagramTwitterSnapChat


 
وصف

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


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

حل بروجكت cpcs203

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

إضافة رد
 
أدوات الموضوع إبحث في الموضوع انواع عرض الموضوع
منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
  #1  
قديم 14-08-2011, 06:10 PM
الصورة الرمزية SPIDER

SPIDER SPIDER غير متواجد حالياً

جامعي

 
تاريخ التسجيل: Aug 2008
التخصص: Computer Engineering
نوع الدراسة: إنتظام
المستوى: متخرج
الجنس: ذكر
المشاركات: 939
Skaau.com (1) حل بروجكت cpcs203


بسم الله الرحمن الرحيم


كيف الحال جميعاً؟ بالأمس قرأت موضوع الأخ will smith عن بروجيكت البرمجة CPCS203: http://www.skaau.com/vb/showthread.php?t=434596 ، والأخ جينتل ما قصر وجاب المشروع. اطلعت عليه اليوم وأعجبني وقلت خليني أحله نقرتين لعرض الصورة في صفحة مستقلة، فحبيت أشارككم حلي ممكن أحد يستفيد منه بطريقة ما نقرتين لعرض الصورة في صفحة مستقلة

 


توقيع SPIDER  

سبحان الله وبحمده .. سبحان الله العظيم

[من برمجتي] ODUS Auto-Adder v1.1 + الكود المصدري

أعتذر عن عدم تمكني على الرد على جميع الرسائل الخاصة ... لا يمكنني إرسال أكثر من رسالة واحدة خلال نصف ساعة تقريباً

 


التعديل الأخير تم بواسطة SPIDER ; 14-08-2011 الساعة 06:19 PM.
رد مع اقتباس

 

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 14-08-2011, 06:10 PM   #2

SPIDER

جامعي

الصورة الرمزية SPIDER

 
تاريخ التسجيل: Aug 2008
التخصص: Computer Engineering
نوع الدراسة: إنتظام
المستوى: متخرج
الجنس: ذكر
المشاركات: 939
افتراضي رد: حل بروجكت cpcs203

CD Class

كود:
public class CD
{
	private String title;
	private String artist;
	private boolean rented;
	private String comment;
	
	public CD(String title, String artist, boolean rented, String comment)
	{
		this.title = title;
		this.artist = artist;
		this.rented = rented;
		this.comment = comment;
	}
	
	public String getTitle(){return title;}
	public void setTitle(String title){this.title = title;}
	
	public String getArtist(){return artist;}
	public void setArtist(String artist){this.artist = artist;}
	
	public String getComment(){return comment;}
	public void setComment(String comment){this.comment = comment;}
	
	public boolean getRented(){return rented;}
	public void setRented(boolean rented){this.rented = rented;}
	
	@Override
	public String toString()
	{
		return "Title: " + title + "\n" +
		       "Artist: " + artist + "\n" +
		       "Is it rented? " + (rented?"yes":"no") + "\n" +
		       "Comment: " + comment;
	}
}

 


التعديل الأخير تم بواسطة SPIDER ; 14-08-2011 الساعة 06:15 PM.
SPIDER غير متواجد حالياً   رد مع اقتباس
 

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 14-08-2011, 06:12 PM   #3

SPIDER

جامعي

الصورة الرمزية SPIDER

 
تاريخ التسجيل: Aug 2008
التخصص: Computer Engineering
نوع الدراسة: إنتظام
المستوى: متخرج
الجنس: ذكر
المشاركات: 939
افتراضي رد: حل بروجكت cpcs203

DVD Class

كود:
public class DVD
{
	private String title;
	private String director;
	private boolean rented;
	private String comment;
	
	public DVD(String title, String director, boolean rented, String comment)
	{
		this.title = title;
		this.director = director;
		this.rented = rented;
		this.comment = comment;
	}
	
	public String getTitle(){return title;}
	public void setTitle(String title){this.title = title;}
	
	public String getDirector(){return director;}
	public void setDirector(String director){this.director = director;}
	
	public String getComment(){return comment;}
	public void setComment(String comment){this.comment = comment;}
	
	public boolean getRented(){return rented;}
	public void setRented(boolean rented){this.rented = rented;}
	
	@Override
	public String toString()
	{
		return "Title: " + title + "\n" +
		       "Director: " + director + "\n" +
		       "Is it rented? " + (rented?"yes":"no") + "\n" +
		       "Comment: " + comment;
	}
}

 


التعديل الأخير تم بواسطة SPIDER ; 14-08-2011 الساعة 06:15 PM.
SPIDER غير متواجد حالياً   رد مع اقتباس
 

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 14-08-2011, 06:15 PM   #4

SPIDER

جامعي

الصورة الرمزية SPIDER

 
تاريخ التسجيل: Aug 2008
التخصص: Computer Engineering
نوع الدراسة: إنتظام
المستوى: متخرج
الجنس: ذكر
المشاركات: 939
افتراضي رد: حل بروجكت cpcs203

MyDatabse Class using Arrays

كود:
import java.util.InputMismatchException;
import java.util.Scanner;

public class MyDatabase
{
	private static Scanner input = new Scanner(System.in);
	private int CDs;
	private int DVDs;
	private CD[] CD_Collection;
	private DVD[] DVD_Collection;
	private char choice;
	
	public MyDatabase()
	{
		System.out.println("The rental system program has begun.");
		System.out.println();
		System.out.println("~=(Getting information from the shop’s employer)=~");
		System.out.println();
		askUser();
		do
        {
			System.out.println();
			System.out.println("~=(Main Menu)=~");
            printMenu();
            choice = input.nextLine().toUpperCase().charAt(0);
            System.out.println();
            switch (choice)
            {
                case 'A':
                	      System.out.print("Insert the title name you are looking for: ");
                		  String CD_title = input.nextLine();
                		  int CD_title_index = -1;
                		  for(int i = 0; i < CDs; i++)
                		  {
                			  if(CD_Collection[i].getTitle().equals(CD_title))
                			  {
                				  CD_title_index = i;
                				  break;
                			  }
                		  }
                		  if(CD_title_index == -1) System.out.println("no matched title.");
                		  else
                		  {
                			  System.out.println("The title name matches the following CD's title name:");
                			  System.out.println(CD_Collection[CD_title_index].toString());
                		  }
                break;
                
                case 'B':
                	      System.out.print("Insert the artist name you are looking for: ");
                	      String artist = input.nextLine();
                	      int artist_index = -1;
                	      for(int i = 0; i < CDs; i++)
                	      {
                	    	  if(CD_Collection[i].getArtist().equals(artist))
                	    	  {
                	    		  artist_index = i;
                	    		  break;
                	    	  }
                	      }
                	      if(artist_index == -1) System.out.println("no matched artist.");
                	      else
                	      {
                	    	  System.out.println("The artist name matches the following CD's artist name:");
                	    	  System.out.println(CD_Collection[artist_index].toString());
                	      }
                break;
                
                case 'C':
                	      System.out.print("Insert the title name you are looking for: ");
                	      String DVD_title = input.nextLine();
                	      int DVD_title_index = -1;
                	      for(int i = 0; i < DVDs; i++)
                	      {
                	    	  if(DVD_Collection[i].getTitle().equals(DVD_title))
                	    	  {
                	    		  DVD_title_index = i;
                	    		  break;
                	    	  }
                	      }
                	      if(DVD_title_index == -1) System.out.println("no matched title.");
                	      else
                	      {
                	    	  System.out.println("The title name matches the following DVD's title name:");
                	    	  System.out.println(DVD_Collection[DVD_title_index].toString());
                	      }
          	    break;
          	              
                case 'D':
                	      System.out.print("Insert the director name you are looking for: ");
                	      String director = input.nextLine();
                	      int director_index = -1;
                	      for(int i = 0; i < DVDs; i++)
                	      {
                	    	  if(DVD_Collection[i].getDirector().equals(director))
                	    	  {
                	    		  director_index = i;
                	    		  break;
                	    	  }
                	      }
                	      if(director_index == -1) System.out.println("no matched director.");
                	      else
                	      {
                	    	  System.out.println("The director name matches the following DVD's director name:");
                	    	  System.out.println(DVD_Collection[director_index].toString());
                	      }
                break;
                
                case 'P': System.out.println("The shop has " +
                		  (CDs == 0? "no CDs":CDs == 1? "only one CD":CDs + " CDs") +
						  " and " + 
						  (DVDs == 0? "no DVDs":DVDs == 1? "only one DVD":DVDs + " DVDs")
						  + ".");
                		  System.out.println();
                		  System.out.println(".:CDs Details:.");
                		  for(int i = 1; i <= CDs; i++)
                		  {
                			  System.out.println("CD#" + i + ":");
                			  System.out.println(CD_Collection[i-1].toString());
                		  }
                		  System.out.println();
                		  System.out.println(".:DVDs Details:.");
                		  for(int j = 1; j <= DVDs; j++)
                		  {
                			  System.out.println("DVD#" + j + ":");
                			  System.out.println(DVD_Collection[j-1].toString());
                		  }
                break;
                
                case 'R':
                		  int rented_CDs = 0;
                		  int rented_DVDs = 0;
                		  for(int i = 1; i <= CDs; i++)
                		  {
                			  if(CD_Collection[i-1].getRented()) rented_CDs++;
                		  }
                		  for(int j = 1; j <= DVDs; j++)
                		  {
                			  if(CD_Collection[j-1].getRented()) rented_DVDs++;
                		  }
                		  System.out.println("The shop has " +
                  		  (rented_CDs == 0? "no rented CDs":rented_CDs == 1? "only one rented CD":rented_CDs + " rented CDs") +
  						  " and " + 
  						  (rented_DVDs == 0? "no rented DVDs":rented_DVDs == 1? "only one rented DVD":rented_DVDs + " rented DVDs")
  						  + ".");
                		  System.out.println();
                  		  System.out.println(".:Rented CDs Details:.");
                  		  int rented_CD_index = 1;
                  		  for(CD myCD : CD_Collection)
                  		  {
                  			  if(myCD.getRented())
                  			  {
                  				  System.out.println("CD#" + rented_CD_index + ":");
                  				  System.out.println(CD_Collection[rented_CD_index-1].toString());
                  				  rented_CD_index++;
                  			  }
                  		  }
                  		  System.out.println();
                  		  System.out.println(".:Rented DVDs Details:.");
                  		  int rented_DVD_index = 1;
                		  for(DVD myDVD : DVD_Collection)
                		  {
                			  if(myDVD.getRented())
                			  {
                				  System.out.println("DVD#" + rented_DVD_index + ":");
                				  System.out.println(DVD_Collection[rented_DVD_index-1].toString());
                				  rented_DVD_index++;
                			  }
                		  }
                break;
                
                case 'Q': System.out.println("The program has been closed.");
                break;
                
                default:  System.out.println(choice + " is invalid choice.");
            }
        }
        while (choice != 'Q');
	}
	
	private void printMenu()
	{
		System.out.println();
        System.out.println("The following choices are available: ");
        System.out.println(" A   Search for a specific CD by a title name.");
        System.out.println(" B   Search for a specific CD by an artist name.");
        System.out.println(" C   Search for a specific DVD by a title name.");
        System.out.println(" D   Search for a specific DVD by a director name.");
        System.out.println(" P   Print a report about all CDs and DVDs available.");
        System.out.println(" R   Print a report about all rented CDs and DVDs available.");
        System.out.println(" Q   Exit the program.");
        System.out.print("Insert your choice: ");
	}
	private void askUser()
	{
		CDs = getUserInteger("How many CDs the shop has? ");
		DVDs = getUserInteger("How many DVDs the shop has? ");
		CD_Collection = new CD[CDs];
		DVD_Collection = new DVD[DVDs];
		System.out.println();
		System.out.println("The shop has " +
						  (CDs == 0? "no CDs":CDs == 1? "only one CD":CDs + " CDs") +
						   " and " + 
						   (DVDs == 0? "no DVDs":DVDs == 1? "only one DVD":DVDs + " DVDs")
						   + ".");
		if(CDs > 0)
		{
			System.out.println();
			System.out.print("Insert CD data:" + "\n");
		}
		for(int i = 1; i <= CDs; i++)
		{
			System.out.println("CD#" + i);
			System.out.print("Title: ");
			String title = input.nextLine();
			System.out.print("Artist: ");
			String artist = input.nextLine();
			boolean rented = getUserYesNo("Is it rented?(Yes/No) ");
			System.out.print("Comment: ");
			String comment = input.nextLine();
			CD_Collection[i-1] = new CD(title, artist, rented, comment);
		}
		if(DVDs > 0)
		{
			System.out.println();
			System.out.println("Insert DVD data:");
		}
		for(int j = 1; j <= DVDs; j++)
		{
			System.out.println("DVD#" + j);
			System.out.print("Title: ");
			String title = input.nextLine();
			System.out.print("Director: ");
			String director = input.nextLine();
			boolean rented = getUserYesNo("Is it rented?(Yes/No) ");
			System.out.print("Comment: ");
			String comment = input.nextLine();
			DVD_Collection[j-1] = new DVD(title, director, rented, comment);
		}
	}
	private boolean getUserYesNo(String question)
	{
		String result;
		
		while(true)
		{
			System.out.print(question);
			result = input.nextLine();
			if(result.equalsIgnoreCase("Yes") || result.equalsIgnoreCase("No"))
			{
				break;
			}
			System.out.println("Wrong input! You can only insert \"Yes\" or \"No\"");
		}
		return result.equalsIgnoreCase("Yes");
	}
	private int getUserInteger(String question)
	{
		int result;
		while(true)
		{
			System.out.print(question);
			try
			{
				result = input.nextInt();
				if(result < 0)
				{
					System.out.println("Wrong input! You can only insert positive integer numbers");
					input.nextLine(); // discard \n
					continue;
				}
				input.nextLine(); // discard \n
				break;
			}
			catch(InputMismatchException ex)
			{
				System.out.println("Wrong input! You can only insert positive integer numbers");
				input.next(); // discard non-integer input
			}
		}
		return result;
	}
}

 


التعديل الأخير تم بواسطة SPIDER ; 14-08-2011 الساعة 06:19 PM.
SPIDER غير متواجد حالياً   رد مع اقتباس
 

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 14-08-2011, 06:16 PM   #5

SPIDER

جامعي

الصورة الرمزية SPIDER

 
تاريخ التسجيل: Aug 2008
التخصص: Computer Engineering
نوع الدراسة: إنتظام
المستوى: متخرج
الجنس: ذكر
المشاركات: 939
افتراضي رد: حل بروجكت cpcs203

MyDatabse Class using ArrayList

كود:
import java.util.ArrayList;
import java.util.InputMismatchException;
import java.util.Scanner;

public class MyDatabase
{
	private static Scanner input = new Scanner(System.in);
	private int CDs;
	private int DVDs;
	private ArrayList<CD> CD_Collection;
	private ArrayList<DVD> DVD_Collection;
	private char choice;
	
	public MyDatabase()
	{
		System.out.println("The rental system program has begun.");
		System.out.println();
		System.out.println("~=(Getting information from the shop’s employer)=~");
		System.out.println();
		askUser();
		do
        {
			System.out.println();
			System.out.println("~=(Main Menu)=~");
            printMenu();
            choice = input.nextLine().toUpperCase().charAt(0);
            System.out.println();
            switch (choice)
            {
                case 'A':
                	      System.out.print("Insert the title name you are looking for: ");
                		  String CD_title = input.nextLine();
                		  int CD_title_index = -1;
                		  for(int i = 0; i < CDs; i++)
                		  {
                			  if(CD_Collection.get(i).getTitle().equals(CD_title))
                			  {
                				  CD_title_index = i;
                				  break;
                			  }
                		  }
                		  if(CD_title_index == -1) System.out.println("no matched title.");
                		  else
                		  {
                			  System.out.println("The title name matches the following CD's title name:");
                			  System.out.println(CD_Collection.get(CD_title_index).toString());
                		  }
                break;
                
                case 'B':
                	      System.out.print("Insert the artist name you are looking for: ");
                	      String artist = input.nextLine();
                	      int artist_index = -1;
                	      for(int i = 0; i < CDs; i++)
                	      {
                	    	  if(CD_Collection.get(i).getArtist().equals(artist))
                	    	  {
                	    		  artist_index = i;
                	    		  break;
                	    	  }
                	      }
                	      if(artist_index == -1) System.out.println("no matched artist.");
                	      else
                	      {
                	    	  System.out.println("The artist name matches the following CD's artist name:");
                	    	  System.out.println(CD_Collection.get(artist_index).toString());
                	      }
                break;
                
                case 'C':
                	      System.out.print("Insert the title name you are looking for: ");
                	      String DVD_title = input.nextLine();
                	      int DVD_title_index = -1;
                	      for(int i = 0; i < DVDs; i++)
                	      {
                	    	  if(DVD_Collection.get(i).getTitle().equals(DVD_title))
                	    	  {
                	    		  DVD_title_index = i;
                	    		  break;
                	    	  }
                	      }
                	      if(DVD_title_index == -1) System.out.println("no matched title.");
                	      else
                	      {
                	    	  System.out.println("The title name matches the following DVD's title name:");
                	    	  System.out.println(DVD_Collection.get(DVD_title_index).toString());
                	      }
          	    break;
          	              
                case 'D':
                	      System.out.print("Insert the director name you are looking for: ");
                	      String director = input.nextLine();
                	      int director_index = -1;
                	      for(int i = 0; i < DVDs; i++)
                	      {
                	    	  if(DVD_Collection.get(i).getDirector().equals(director))
                	    	  {
                	    		  director_index = i;
                	    		  break;
                	    	  }
                	      }
                	      if(director_index == -1) System.out.println("no matched director.");
                	      else
                	      {
                	    	  System.out.println("The director name matches the following DVD's director name:");
                	    	  System.out.println(DVD_Collection.get(director_index).toString());
                	      }
                break;
                
                case 'P': System.out.println("The shop has " +
                		  (CDs == 0? "no CDs":CDs == 1? "only one CD":CDs + " CDs") +
						  " and " + 
						  (DVDs == 0? "no DVDs":DVDs == 1? "only one DVD":DVDs + " DVDs")
						  + ".");
                		  System.out.println();
                		  System.out.println(".:CDs Details:.");
                		  for(int i = 1; i <= CDs; i++)
                		  {
                			  System.out.println("CD#" + i + ":");
                			  System.out.println(CD_Collection.get(i-1).toString());
                		  }
                		  System.out.println();
                		  System.out.println(".:DVDs Details:.");
                		  for(int j = 1; j <= DVDs; j++)
                		  {
                			  System.out.println("DVD#" + j + ":");
                			  System.out.println(DVD_Collection.get(j-1).toString());
                		  }
                break;
                
                case 'R':
                		  int rented_CDs = 0;
                		  int rented_DVDs = 0;
                		  for(int i = 1; i <= CDs; i++)
                		  {
                			  if(CD_Collection.get(i-1).getRented()) rented_CDs++;
                		  }
                		  for(int j = 1; j <= DVDs; j++)
                		  {
                			  if(CD_Collection.get(j-1).getRented()) rented_DVDs++;
                		  }
                		  System.out.println("The shop has " +
                  		  (rented_CDs == 0? "no rented CDs":rented_CDs == 1? "only one rented CD":rented_CDs + " rented CDs") +
  						  " and " + 
  						  (rented_DVDs == 0? "no rented DVDs":rented_DVDs == 1? "only one rented DVD":rented_DVDs + " rented DVDs")
  						  + ".");
                		  System.out.println();
                  		  System.out.println(".:Rented CDs Details:.");
                  		  int rented_CD_index = 1;
                  		  for(CD myCD : CD_Collection)
                  		  {
                  			  if(myCD.getRented())
                  			  {
                  				  System.out.println("CD#" + rented_CD_index + ":");
                  				  System.out.println(CD_Collection.get(rented_CD_index-1).toString());
                  				  rented_CD_index++;
                  			  }
                  		  }
                  		  System.out.println();
                  		  System.out.println(".:Rented DVDs Details:.");
                  		  int rented_DVD_index = 1;
                		  for(DVD myDVD : DVD_Collection)
                		  {
                			  if(myDVD.getRented())
                			  {
                				  System.out.println("DVD#" + rented_DVD_index + ":");
                				  System.out.println(DVD_Collection.get(rented_DVD_index-1).toString());
                				  rented_DVD_index++;
                			  }
                		  }
                break;
                
                case 'Q': System.out.println("The program has been closed.");
                break;
                
                default:  System.out.println(choice + " is invalid choice.");
            }
        }
        while (choice != 'Q');
	}
	
	private void printMenu()
	{
		System.out.println();
        System.out.println("The following choices are available: ");
        System.out.println(" A   Search for a specific CD by a title name.");
        System.out.println(" B   Search for a specific CD by an artist name.");
        System.out.println(" C   Search for a specific DVD by a title name.");
        System.out.println(" D   Search for a specific DVD by a director name.");
        System.out.println(" P   Print a report about all CDs and DVDs available.");
        System.out.println(" R   Print a report about all rented CDs and DVDs available.");
        System.out.println(" Q   Exit the program.");
        System.out.print("Insert your choice: ");
	}
	private void askUser()
	{
		CDs = getUserInteger("How many CDs the shop has? ");
		DVDs = getUserInteger("How many DVDs the shop has? ");
		CD_Collection = new ArrayList<CD>();
		DVD_Collection = new ArrayList<DVD>();
		System.out.println();
		System.out.println("The shop has " +
						  (CDs == 0? "no CDs":CDs == 1? "only one CD":CDs + " CDs") +
						   " and " + 
						   (DVDs == 0? "no DVDs":DVDs == 1? "only one DVD":DVDs + " DVDs")
						   + ".");
		if(CDs > 0)
		{
			System.out.println();
			System.out.print("Insert CD data:" + "\n");
		}
		for(int i = 1; i <= CDs; i++)
		{
			System.out.println("CD#" + i);
			System.out.print("Title: ");
			String title = input.nextLine();
			System.out.print("Artist: ");
			String artist = input.nextLine();
			boolean rented = getUserYesNo("Is it rented?(Yes/No) ");
			System.out.print("Comment: ");
			String comment = input.nextLine();
			CD_Collection.add(new CD(title, artist, rented, comment));
		}
		if(DVDs > 0)
		{
			System.out.println();
			System.out.println("Insert DVD data:");
		}
		for(int j = 1; j <= DVDs; j++)
		{
			System.out.println("DVD#" + j);
			System.out.print("Title: ");
			String title = input.nextLine();
			System.out.print("Director: ");
			String director = input.nextLine();
			boolean rented = getUserYesNo("Is it rented?(Yes/No) ");
			System.out.print("Comment: ");
			String comment = input.nextLine();
			DVD_Collection.add(new DVD(title, director, rented, comment));
		}
	}
	private boolean getUserYesNo(String question)
	{
		String result;
		
		while(true)
		{
			System.out.print(question);
			result = input.nextLine();
			if(result.equalsIgnoreCase("Yes") || result.equalsIgnoreCase("No"))
			{
				break;
			}
			System.out.println("Wrong input! You can only insert \"Yes\" or \"No\"");
		}
		return result.equalsIgnoreCase("Yes");
	}
	private int getUserInteger(String question)
	{
		int result;
		while(true)
		{
			System.out.print(question);
			try
			{
				result = input.nextInt();
				if(result < 0)
				{
					System.out.println("Wrong input! You can only insert positive integer numbers");
					input.nextLine(); // discard \n
					continue;
				}
				input.nextLine(); // discard \n
				break;
			}
			catch(InputMismatchException ex)
			{
				System.out.println("Wrong input! You can only insert positive integer numbers");
				input.next(); // discard non-integer input
			}
		}
		return result;
	}
}

 


التعديل الأخير تم بواسطة SPIDER ; 14-08-2011 الساعة 06:19 PM.
SPIDER غير متواجد حالياً   رد مع اقتباس
 

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 14-08-2011, 06:17 PM   #6

SPIDER

جامعي

الصورة الرمزية SPIDER

 
تاريخ التسجيل: Aug 2008
التخصص: Computer Engineering
نوع الدراسة: إنتظام
المستوى: متخرج
الجنس: ذكر
المشاركات: 939
افتراضي رد: حل بروجكت cpcs203

Main Class

كود:
public class Main
{
    public static void main(String[] args)
    {
        new MyDatabase();
    }
}

 

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

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 15-08-2011, 04:43 PM   #7

gentle man

جامعي

 
تاريخ التسجيل: Feb 2010
نوع الدراسة: إنتظام
المستوى: معتذر
الجنس: ذكر
المشاركات: 845
افتراضي رد: حل بروجكت cpcs203

جزاك الله كل خير ..

بالتوفيق ..

 

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

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 15-08-2011, 11:00 PM   #8

will smith

جامعي

 
تاريخ التسجيل: Feb 2010
التخصص: IT
نوع الدراسة: إنتظام
المستوى: الخامس
الجنس: ذكر
المشاركات: 12
افتراضي رد: حل بروجكت cpcs203

أخوي يا ريت تشرح لي النقطتين ذي لاهنت

System.out.print("Insert the title name you are looking for: ");
String CD_title = input.nextLine();
int CD_title_index = -1;
for(int i = 0; i < CDs; i++)
{
if(CD_Collection[i].getTitle().equals(CD_title))
{
CD_title_index = i;
break;
}
}
if(CD_title_index == -1) System.out.println("no matched title.");
else
{
System.out.println("The title name matches the following CD's title name:");
System.out.println(CD_Collection[CD_title_index].toString());
}
break;



int rented_CDs = 0;
int rented_DVDs = 0;
for(int i = 1; i <= CDs; i++)
{
if(CD_Collection[i-1].getRented()) rented_CDs++;
}
for(int j = 1; j <= DVDs; j++)
{
if(CD_Collection[j-1].getRented()) rented_DVDs++;
}
System.out.println("The shop has " +
(rented_CDs == 0? "no rented CDs":rented_CDs == 1? "only one rented CD":rented_CDs + " rented CDs") +
" and " +
(rented_DVDs == 0? "no rented DVDs":rented_DVDs == 1? "only one rented DVD":rented_DVDs + " rented DVDs")
+ ".");
System.out.println();
System.out.println(".:Rented CDs Details:.");
int rented_CD_index = 1;
for(CD myCD : CD_Collection)
{
if(myCD.getRented())
{
System.out.println("CD#" + rented_CD_index + ":");
System.out.println(CD_Collection[rented_CD_index-1].toString());
rented_CD_index++;
}
}
System.out.println();
System.out.println(".:Rented DVDs Details:.");
int rented_DVD_index = 1;
for(DVD myDVD : DVD_Collection)
{
if(myDVD.getRented())
{
System.out.println("DVD#" + rented_DVD_index + ":");
System.out.println(DVD_Collection[rented_DVD_index-1].toString());
rented_DVD_index++;
}
}

وجزاك الله خير وما قصرت

 

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

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 17-08-2011, 02:27 AM   #9

Mr.Ahmad

عضو هيئة تدريس

الصورة الرمزية Mr.Ahmad

 
تاريخ التسجيل: Jul 2008
كلية: كلية الحاسبات وتقنية المعلومات
التخصص: IT
نوع الدراسة: عضو هيئة تدريس
المستوى: متخرج
البلد: جــــدة
الجنس: ذكر
المشاركات: 2,477
افتراضي رد: حل بروجكت cpcs203

جزاك الله خير

 

توقيع Mr.Ahmad  

 

سبحان الله وبحمد ,,, سبحان الله العظيم
الحمد لله كما ينبغي لجلال وجهه وعظيم سلطانه .
اللهم صل على محمد وعلى آل محمد كما صليت على إبراهيم وعلى آل إبراهيم إنك حميد مجيد . اللهم بارك على محمد وعلى آل محمد كما باركت على إبراهيم وعلى آل إبراهيم إنك حميد مجيد.

 

Mr.Ahmad غير متواجد حالياً   رد مع اقتباس
 

إضافة رد


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

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

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

 


الساعة الآن 07:08 PM


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

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

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

2003-2023