InstagramTwitterSnapChat


 
وصف

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


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

لوسمحت ابغى شرح بسيط مع الحل لاثنين التسليم

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

إضافة رد
 
أدوات الموضوع إبحث في الموضوع انواع عرض الموضوع
منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
  #1  
قديم 03-11-2012, 08:01 PM

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

جامعي

 
تاريخ التسجيل: Jul 2012
التخصص: سنة تحضيري
نوع الدراسة: تحضيري علمي خطة أ
المستوى: الأول
الجنس: ذكر
المشاركات: 10
Skaau.com (15) لوسمحت ابغى شرح بسيط مع الحل لاثنين التسليم


Project 2 Deion:
In this project, write a Java program that will convert an input metric to a corresponding value in the International System of Units. Input metric will be in Yards, Inches, Miles, and Pounds. The converted metric should be converted as follows:
Table 1:

Input Metric


Output Metric


Yards


Meters


Inches


Centimeters


Miles


Kilometers


Pounds


Kilogram



The program should display a Menu for the user to choose from the above metric. The menu is shown in the figure below.



Welcome to Multi conversion System
Press c for Inches to Centimeters
Press m for Yards to Meters
Press k for Miles to Kilometers
Press g for Pounds to Kilograms

The user has to enter c, m, k, or g. Next, the user will enter a value for the input metric which the program will convert to the specified unit from table 1. The output of the program should be the converted metric value. In addition, consider the following scenarios in the output:
1. If the user inputs a character that is not recognized (NOT c, m, k, or g), then the program prints “Wrong Selection!”, and exits.
2. If the user inputs a value less than zero for a metric, the program will display a message that states “Cannot convert a negative value!
3. After displaying the converted metric value (if input value is not negative), the program should also display the range of the converted value according to the following rules:
a. If converted value is less than 20, print “Less than 20.”
b. If converted value is less than 50, print “Less than 50.”
c. If converted value is equal 50, print “Equal 50”.
d. If converted value is greater than 50, print “Greater than 50.”
Hint 1: To read a character using a Scanner input, use the following statement:
char c = input.nextLine().charAt(0);
Hint 2: To convert a metric use the following formulas:
Centimeters = 2.54 * inches
Meters = 0.9144 * Yards
Kilometers = 1.60934 * Miles
Kilograms = 0.453592 * Pounds

Note: Submit only the source code. For example: IA_1110348_P2.java
Sample Program Run #1:



Welcome to Multi conversion System
Press c for Inches to Centimeters
Press m for Yards to Meters
Press k for Miles to Kilometers
Press g for Pounds to Kilograms

k
Enter a value in Miles: 10
Your 10.0 Miles are 16.0934 Kilometers. Less than 20.

Sample Program Run #2:
Welcome to Multi conversion System
Press c for Inches to Centimeters
Press m for Yards to Meters
Press k for Miles to Kilometers
Press g for Pounds to Kilograms

y
Wrong Selection!






Sample Program Run #3:
Welcome to Multi conversion System
Press c for Inches to Centimeters
Press m for Yards to Meters
Press k for Miles to Kilometers
Press g for Pounds to Kilograms

g
Enter a value in Miles: -20
Cannot convert a negative value!

Sample Program Run #4:
Welcome to Multi conversion System
Press c for Inches to Centimeters
Press m for Yards to Meters
Press k for Miles to Kilometers
Press g for Pounds to Kilograms




c
Enter a value in Inches: 100
Your 100.0 Inches are 254.0 Centimeters. Greater than 50.
رد مع اقتباس

 

إضافة رد


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

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

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

 


الساعة الآن 07:40 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