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

deathpain

devkemo

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

 
تاريخ التسجيل: Dec 2010
كلية: كلية الحاسبات وتقنية المعلومات
التخصص: Computer Science
نوع الدراسة: إنتظام
المستوى: الثامن
البلد: جــــدة
الجنس: ذكر
المشاركات: 770
افتراضي رد: بعض حلول sheet 5 في البرمجه

أدري إني طفشتكم ،،
بس هذا التصحيح حق سؤال التحويل من مئوي إلى فهرنهايت،،
كود PHP:
import java.util.*;
/
 *
 * @
author deathpa1N
 
*/
public class 
CandF {
    public static 
void main(String[] args) {
int option,degree,celsius,fahrenheit;
Scanner input = new ScannerSystem.in );
option 0;
while ( 
option != ){
System.out.printf"%s\n%s\n%s\n""1 for Fahrenheit to Celsius","2 for Celsius to Fahrenheit""3 to quit:" );
option input.nextInt();
if (
option==1){
System.out.println"Enter the degrees in Fahrenheit: " );
degree input.nextInt();
celsius = ( degree 32 ) * 9;
System.out.println"The temp in Celsius is "+celsius );}
else if (
option==2){        
System.out.println"Enter the degrees in Celsius: " );
degree input.nextInt();
    
fahrenheit = ( degree ) + 32;
System.out.println"The temp in Fahrenheit is "fahrenheit );}
else {
System.exit(0);}
 }
  }

بالتوفيق ،،

 

توقيع deathpain  

 



في حال وجود أي استفسار أو سؤال حول الجافا CPCS202 الرجاء كتابة استفسارك مباشرة في موضوعي هنا:

تطبيق - معدلي الجامعي - التطبيق الأسهل لحساب المعدل الجامعي
http://skaau.com/vb/showthread.php?t=745520

 

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