قناة سكاو في الواتساب
 


حسابنا في السناب شاتحسابنا في منصة Xقناتنا في اليوتيوبحسابنا في التيك توكقناتنا في التيليجرامقناة سكاو في الواتساب
 
وصف

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


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

lab sheet 6

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

قناتنا في الواتساب

إضافة رد
 
أدوات الموضوع إبحث في الموضوع انواع عرض الموضوع
منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
  #1  
قديم 23-12-2011, 02:52 PM

الماسة 6 الماسة 6 غير متواجد حالياً

جامعي

 
تاريخ التسجيل: Dec 2011
التخصص: حاسب
نوع الدراسة: إنتظام
المستوى: الثالث
الجنس: أنثى
المشاركات: 95
افتراضي رد: lab sheet 6


1 // Lab 3: Multiply.java
2 // Program generates single digit multiplication problems
3 import java.util.*;
4
5 public class MultiplyTest
6 {
7 public static void main( String args[] )
8 {
9
quiz();
11 } // end main
12
13 // ask the user to answer multiplication problems
14 public void quiz()
15 {
16 Scanner input = new Scanner( System.in );
17
18 int guess; // the user's guess
19 int answer; // the correct answer

20 /* write code to call method createQuestion to display the question and return the correct answer */
21
22 System.out.println( "Enter your answer (-1 to exit):" );
23 guess = input.nextInt();
24
25 while ( guess != -1 )
26 {
27 /* write code to call the method checkResponse to check the user's answer and return the result */
/* if checkResponse is true, write code to call method createQuestion to display the question and return the correct answer */
28
29 System.out.println( "Enter your answer (-1 to exit):" );
30 guess = input.nextInt();
31 } // end while
32 } // end method
33
34 // prints a new question and returns the corresponding answer
35 /* write method header for the createQuestion method */
36 {
37 // get two random numbers between 0 and 9
38 /* Write code to get two random numbers and store them in variables digit1 and digit2. */
39 /* Write code to multiply the two variables and store the result
40 in the return variable */
41 System.out.printf( "How much is %d times %d?\n", digit1, digit2 );
42 } // end method createQuestion
43
44 // checks if the user answered correctly and return the result of the comparison as a boolean variable
45 /* Write method header for checkResponse */
46 {
boolean correct; // true when the answer is correct
47 /* Write code to test whether the answer is incorrect */
48 /* Write code to tell the user to try again, if the answer is incorrect and set the Boolean variable */
49 else
50 {
51 System.out.println( "Very Good!" );
52 /* Write code to call method createQuestion to display another question */
53 } // end else
54 } // end method checkResponse
55 } // end class MultiplyTest
وكمان دا السوال عقدني
تكفون بكرة الامتحان
رد مع اقتباس

 

إضافة رد

أدوات الموضوع إبحث في الموضوع
إبحث في الموضوع:

البحث المتقدم
انواع عرض الموضوع

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

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

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

 


الساعة الآن 09:54 AM


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

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

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

2003-2026