بسم الله الرحمن الرحيم
السلام عليكم ورحمة الله وبركاته
هذي اول مشاركه لي اتمنى ترحبوا فيني وتساعدوني طبعا انا جديده وما اعرف شو نظام منتداكم بس حبيت استفيد من خبراتكم ومساعداتكم انا عندي سؤلين بالجافا انا حليتهم بس مو نفس المطلوب
السؤال الاول
Write a program that will print out the following multiplication tables (3 across): 4 times table 5 times table 6 times table 1 x 4 = 4 1 x 5 = 5 1 x 6 = 6 2 x 4 = 8 2 x 5 = 10 2 x 6 = 12 . . . 12 x 4 = 48 12 x 5 = 60 12 x 6 = 72
وهذا الكود بس مو راضي يطلعلي نفس الاوت بوت
public class Q3
{
public static void main(String[]args)
{
int i, j;
System.out.print("4 Time\n");
for(i=4;i<=6;i++)
{
System.out.printf("");
{
for(j=1;j<=12;j++)
System.out.printf("%d X %d = %d\n", i, j, i * j);
}
System.out.print("\t");
}
}
}
طبعا طلعلي الاوت بوت تحت بعض وانا ابغاه يكون الثلاث اعمده بجنب بعض يعني جدول ضرب
-----------------------------------------------------------------------------------------------------------------------------------------------
السؤال الثاني:
An online retailer sells five products whose retail prices are as follows
pryduct
1
2
3
4
5
price
$2.98
$4.50
$9.98
$4.49
$6.87
write an application that reads a serise of pairs of numbers as follows:
a) product number
b)quantity sold
you application should calculate and display the total retail value of all pruducts sold use sentinel controlled loop to stop the program
وهذا الكود بس ماعرفت كيف اكمله
import java.util.Scanner;
public class Q4
{
public static void main(String[] args)
{
Scanner input = new Scanner (System.in);
int product = 0;
double product1;
double product2;
double product3;
double product4;
double product5;
int quantity;
String done = "y";
double totalSales = 0;
while (done.equals("y"))
{
System.out.println("Enter product number: ");
System.out.println("Enter how many were sold: ");
quantity = input.nextInt();
switch (product)
{
case 1: product1 =" 2.98";
break;
case 2: product2 = 4.50;
break;
case 3: product3 = 9.98;
break;
case 4: product4 = 4.49;
break;
case 5: product5 = 6.87;
break;
}
totalSales = product * quantity;
System.out.println("Would you like to enter another sale? (y/n): ");
done = input.next();
}
}
}احسه فيه شي غلط بس مو عاارفه ايش هو
الله يسعدكم اتمنى تساعدووني ابغى التصحيح باقرب وقت



