السلام عليكم ورحمة الله وبركاته..
كيفكم؟!...وكل عــــــــاام وانتم بخير...وعيـــــدكـــم مبااااارك....
امممم انا جيت وجبتلكم عيديتكم وابيكم تساعدوني فيها.. :blush: :blush:
عندي كم سؤال وبصرااحه كل سؤال له حكااية معايا ولي مغامرات فيه والشهادة لله اني حاولت ودورت بس وربي تعبت حتى ما تهنيت بالعيد من كثر ما انا شايله همها... :sad: :sad:
طبعا كل سؤال راح اكتبه واكتب عليه محاولاتي وفهمي له وانتوا شوفوه لي اذا انا فاهمته غلط او محاولتي اصلا غلط ياليت تساعدوني واكوون شااكره لكم
السؤال الاول:
Write a program that reads month, day and year and For a given date (Gregorian calendar) the
corresponding day of the week is printed out. ( Using methods)
بصرااحه هذا السؤال تعععععبني بس شوفوا محاولاتي..
class month
{
public int date;
public int month1;
public int year;
public int day;
Scanner input= new Scanner (System.in);
public void GregorianCalendar(int year, int month1, int date)
{
System.out.println("Enter the day:"+day);
day = input.nextInt();
System.out.println("Enter the month:"+month1);
month1= input.nextInt();
System.out.println("Enter the year:"+year);
year= input.nextInt();
}
/* public void displayMessage()
{
if()
}*/
}
وهذا الكود الثاني:..
{
public static void main(String[]args)
{
month m1=new month();
m1.GregorianCalendar();
m1.displayMessage();
}
}
طبعا اللاوت بوت المطلوب:..
Enter the day:
26
Enter the month:
10
Enter the year:
2011
Wenesday
اتمنى تسسساعدووني فيه
نجي للسؤال الثاني:
Write a C program that simulates an ATM machine which has the following menus:
1. Deposit
2. Withdraw
3. Display Balance
4. Other (optional)
The user of the program should be able to repeat the menu and perform the menu upon user request.
The following is the sample of the screen. Suppose your account has amount of $10000
وهنا محاولتي:
public class Q2
{
public int Deposit;
public int Withdraw;
public int Deposit(int d)
{
Deposit=d;
return Deposit;
}
public int Withdraw(int w)
{
Withdraw=w;
return Withdraw;
}
Scanner input= new Scanner(System.in);
public void displaybalance()
{
System.out.println("********************MENU********************");
System.out.println("* A : WITHDRAW *");
System.out.println("* B : DEPOSIT *");
System.out.println("* * *");
System.out.println("* * *");
System.out.println("********************MENU********************");
int select=0;
System.out.print("Select Menu:");
int a=input.nextInt();
int b=input.nextInt();
if(select==a)
{
System.out.println("Enter withdrw amount:$%d"+a);
}
else
{
System.out.println("Enter deposit amount:$%d"+a);
}
}
}
import java.util.Scanner;
وهذا الكود الثاني:
public class Q2test
{
public static void main(String[]args)
{
Q2 q1 =new Q2();
q1.display();
}
}
ومدري انا ما عرفت اكمله حسيت انه فيه شي غلط اتمنى تحطوا لمساتكم الحلوه عليه
وطبعا الاوت بوت المطلوب:
*******************MENU**********************
* A: WITHDRAW *
* B: DEPOSIT *
* * *
* * *
*****************MENU***********************
Select Menu: a
Enter withdraw amount : $2500
Main Menu [Y/N] : n
---------------------Your balance is 7500----------------------
-------------------THANK YOU , COME AGAIN----------------
السؤال الثالث:
Create a simple Java program that prompts the user to enter a real number, and then
prints the following information, with appropriate descriptive text: (Using methods)
1. The area and circumference of the circle with that radius.
2. The area, perimeter, and length of diagonal of the square that has sides of that
length. (Use the Pythagorean theorem to calculate the length of the diagonal.)
3. The volume and surface area of the sphere with that radius.
(Hint : - The formula for the volume of a sphere with radius r is (4/3) π r3.The formula for
the surface area of a sphere with radius r is 4 π r2.)
امممممم هذا السؤال مررررررررررررررررررررره ما فهمته ولا عرفتله يااااااااريت تسااعدوني وربي تعبت بليز بليز لو بس تشرحولي هو كيف احله
وكــــل عاام وانتم بخيـــــر ....انتظر لمسااتكم بليييز لاتتركوني مالي الا الله ثم انتم.. :blush: :sad: :sad:
