الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

مساعده في ال c++

بدأه LouLia في 31 أكتوبر 2010 · 7 رد · 671 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

بسم الله الرحمن الرحيم

أرجو المساعده يا اخواني الاعزاء في المسائل التاليه قبل موعد التسليم في ماده ال c++ . و لكم مني جزيل الشكر :)

write a program to read in the weight ( in kilogram ) of an object , and compute and print its weight in grams and pound

one pound is equal to 0.453592 kilograms

__________________________________________________________________

write a program tHAT read in asingle value R , and then computes and prints

the area of circle having a radius

the volume of sphere having a radius R

____________________________________________________________________

write a program tHAT read the volume of cube , and then computers and prints the surface area of the largest sphere that can fit in that cube

بأنتظاركم ,,,

#3

حاولت ولكن لا اعلم هل هو صحيح ام خطا

السوال الاول نفرض انه الx التي نريد ادخالها مثلا رقم 2 و هي بالكيلوجرام

#include <iostream>

using namespace std;

int main()

{

int x;

cout << " enter a kilogram" << endl;

cin >> x;

cout << " wegiht in gram";

cout <<x*1000 << endl;

cout << "weght in pound";

cout << x/0.453592 << endl ;

system ("pause");

return 0;

}

__________________________________

السوال الثاني

#include <iostream>

#include < cmath >

using namespace std;

int main()

{

int R;

cout << " enter a asingle value R " << endl;

cin >> R;

cout << "the area of circle";

cout << 3.14*pow(R,2);system ("pause");

return 0;

}

و لكن الي هذه الخطوه يظهر لي خطأ

____________________________________

السوال الثالث

الذي اعرفه هو read ثم اقف عند ذلك

أشكرك اخي علي ردك

#4

طيب :)

أنا لا أفهم الإنجليزية لأننا ندرس بالفرنسية فقط :)

بإمكانك ترجمة التمارين إلى العربية أو الفرنسية و سأضع لك الحل و بالشرح المفصل إن أردت :)

#5

السلام عليكم ..

السؤال الأول :

#include <iostream>
using namespace std;
int main()
{
int x;
cout << " Enter a kilogram : " << endl;
cin >> x;
cout << " Wegiht in gram : ";
cout <<x*1000 << endl;
cout << " Weght in pound : ";
cout << x/0.453592 << endl ;
system ("pause");
return 0;
}

السؤال الثاني :

#include <iostream>
#include < cmath >
using namespace std;
int main()
{
double R ;
cout <<"Enter a asingle value R : "  cin >> R ;
cout <<"The Area of circle : "<<3.14*pow(R,2)<<endl;
cout<<"Volume of the sphere : "<<(4*3.14*pow(R,3))/3<<endl; 
system ("pause");
return 0;
}

سبحآن الله وبحمده .. سبحآن الله العظيم .. ,

#6

literals in your program must be declared as contants

choose appropriate names for variables

your program should use input prompts and echo printing for all data read from the user

باقي السوال الاخير :

write a program tHAT read the volume of cube , and then computers and prints the surface area of the largest sphere that can fit in that cube

أشكركم علي ردودكم

لا اعرف كيف اترجم الي الفرنسيه شكرا لمرورك :)

تم تعديل هذه المشاركة بواسطة LouLia في 1 نوفمبر 2010 في 15:30

#7
LouLia كتب:

literals in your program must be declared as contants

choose appropriate names for variables

your program should use input prompts and echo printing for all data read from the user

باقي السوال الاخير :

write a program tHAT read the volume of cube , and then computers and prints the surface area of the largest sphere that can fit in that cube

أشكركم علي ردودكم

تفضل:

السوال الأول:

# include <iostream>

using namespace std;

int main()
{
	float kilo,gram,pound; 
	cout<<"\nEnter a weight (in kilogram):";
	cin>>kilo;

	const float Kilo_pound= 0.453592; // 1 kilogram = 0.453592 pound
	const int Kilo_gram= 1000;		  // 1 kilogram = 1000 gram

	gram= kilo*Kilo_gram;
	pound=kilo/Kilo_pound;

	cout<<"\nYour number was (in kilogram):"
		<<kilo;
	cout<<"\nIt is in gram="
		<<gram;
	cout<<"\nIt is in pound="
		<<pound
		<<endl;

	system("pause");

	return 0;
}

السوال الثانی:

#include <iostream> 
#include < cmath > 
using namespace std; 
int main() 
{ 
float R ; 
cout <<"Enter a asingle value R : ";
cin >> R;

const float Pi = 3.14;
float circle_area= Pi*pow(R,2);				//calculating the area of circle
float sphere_volume= (4*Pi*pow(R,3))/3;		//calculating the volume of the sphere

cout <<"The Area of circle: "<<circle_area
	<<endl; 
cout<<"Volume of the sphere: "<<sphere_volume
	<<endl;

system ("pause"); 
return 0; 

}

السوال الثالث:

#include <iostream>
#include <cmath>

using namespace std;

int main()
{
	double volume; // volume of the cube
	cout<<"\nEnter the volume of the cube:";
	cin>>volume;

	double side=pow((volume),1.0/3.0); // calculating the cube root of the number. answer is side of the cube
	double radius=side/2; // diagonal of the circle is equal with side of the cube.

	const float Pi=3.14;

	double surface_of_sphere= 2*radius*Pi; // calculating the surface of the largest sphere in cube.

	cout<<"surface area of the largest sphere that can fit in that cube is:"
		<<surface_of_sphere
		<<endl;

	system("pause");
	return 0;
}

شکرا لأخت إشراقة فجر. الجواب الثانی کان جوابها مع تغییر صغیر.

و شکرا لک ایضا. لهذا السوال.

بحث لجواب هذا السوال وجب علی أن أنا أقرأ الدروس الماضی فی المدرسة و أیضا الجامعة و و فهمت بعض شیء مفید خلال حل هذا السوال.

اقتباس
لا اعرف كيف اترجم الي الفرنسيه شكرا لمرورك

أکتب بالعربیة

تم تعديل هذه المشاركة بواسطة u77431 في 2 نوفمبر 2010 في 14:28

#8

شكرا للجميع بالاخص الاخت اشراقه فجر و الاخ u77431 علي مساعدتي

اتمني لكم التوفيق و سامحوني اتعبتكم معي

مواضيع مشابهة