السلام عليكم ورحمة الله وبركاته.................
اسمحوا لي عالإزعاج ....بس بغيت مساعدتكم في حل هالمشكلة اللي موهجتني
وهو كتابة كود جافا1 ..وعلي التسليم اليوم قبل الساعة 9 بالليل..أنا حليت البرنامج..واشتغل عندي..بس الطريقة أحسها خطأ.. أنا بحطي السؤال والملف اللي فيه الكود اللي كتبته...ولي طلب أخير ...ممكن تحطون كود c++ كيف نحول من any base to decimal والعكس..لأني أنا أعرف أحول من binary to decimal بس....والسموحة عالإزعاج....
السؤال
You are required to implement an applet in Java that draw a swimming pool (rectangle) with surrounding side walk (rectangle). Your applet size is fixed (width = 600, height = 400). The swimming pool size (width as well as height) and its side walk are variables. Your important task is to scale down the pool size and its side walk to fit (to be drawn within) the applet size. Accordingly, your inputs to the program are:
(1) Swimming pool size: width and height in meter (real numbers), and
(2) Side walk width around the swimming pool in meter (real number),
Your program (Java Applet) will calculate the side walk size (the new rectangle width and height) and compare it with the Applet size.
If the applet size is greater than the side walk rectangle (the outside rectangle), then no scaling is needed and the swimming pool as well as its side walk can be drawn
Else your program must calculate the scaling factor s, apply it to all the rectangles dimensions, and draw the swimming pool as well as its side walk.
In each case, your program must determine the starting point of each rectangle after converting real number to the nearest integer. Also, your program must print all the data used to draw the swimming pool and its side walk