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

سؤال بلغة سي ++

بدأه maya1988 في 4 يناير 2012 · 8 رد · 641 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

هاي

وكل عام وانتم بخير بمناسبة السنة الجديدة

حبيت اطرح هالسؤال لكل مختص بلغات البرمجة

انا عندي برنامج مساوى ومنتهي كامل

انا اريد ان اكتبه على برنامج الفيجوال استديو بلغة سي ++

فمن يعرف الاجابة الا يبخل عليييي بكرمه

ولكم جزيل الشكر

البرنامج على الرابط التالي

http://www.mediafire.com/?x1855g5xcluzfwz

#2

شو معقول هالقد سؤالي صعب

@!!!!!!!!!!!!!!!!!!!!!!!!!

#3

ﻻ احد يعرف برنامج ان كان فيرس ام شئ اخر ارفقي مجموعة صور للبرنامج وايا توضيح لماتحبين وايضا ﻻتنسى محاولاتك

post-15367-027053900%201340345097.gifpost-15367-087183200%201340344597.gif
post-247365-0-10080400-1379403554_thumb.

#4

اسفة لم اكن اعلم

هذه الصورة

عندما نضع رقم 1 يظهر choise apple

انا اضع الوزن مثلا 2

وثم اضع الرقم 2 يظهر orang

واضع الوزن 3

وهكذا

وعندما اختار الرقم 0 يتوقف عن العمل

ويضع لي المجموع (بعد ضرب السعر البضاعةب الوزن)

ارجوا ان يكون شرحي وافي

وعلى هذه الرابط

http://www.mediafire.com/?24ngl3bfhgrfttm

post-255481-005518400 1325950007_thumb.p

المرفقات
Untitled.png

تم تعديل هذه المشاركة بواسطة maya1988 في 7 يناير 2012 في 19:06

#5

أختى لقد كتبت هذا الكود فى الوقت الحالى وسأكملة لاحقا ان شاء الله:

حاولى اكمالة حتى لقاء اخر:

#include <iostream>
using namespace std;
struct list
{
    string fruits;
    int sp;
};
int main()
{
    int card[4] = {0};
    int choice = 0;
    list lst[4] ;
    lst[0].fruits = "Apple";
    lst[1].fruits = "Orange";
    lst[2].fruits = "Tomatos";
    lst[3].fruits = "Bananas";
    lst[0].sp = 40;
    lst[1].sp = 50;
    lst[2].sp = 35;
    lst[3].sp = 55;

    cout << "Wellcome to Abo-Abdo international company of fruits !!"<< endl;
    cout << "Please enter ur choice: " << endl;
    for(int i = 0; i < 4; i++)
        cout << i+1 << ": " << lst.fruits<<"       " << lst.sp <<" s.p." << endl;
    int i = 0;

    do
    {
        int chs = 0;
        cout << "ur choice is: ";
        cin >> choice;

        if(choice < 0 || choice > 3) break;

        card[i++] = choice;
        cout << "u chosen: " << lst[choice].fruits;
    }
    while (choice != 0);

    return 0;
}
1

post-15367-027053900%201340345097.gifpost-15367-087183200%201340344597.gif
post-247365-0-10080400-1379403554_thumb.

#6

شكرا اخي الكريم

لكن انا جربت طريقة ربما هي ناقصة

cout<<"u shoise"<<endl;

int x,y1,y2;

cin>>x;

if(x=1)

{

cout<<"apple wight"<<endl;

cin>>y1;

}

if(x=2)

{

cout<<"orange wight"<<endl;

cin>>y2;

}

if(x=0)

{

cout<<"total"<<endl;

cout<<y1*40+y2*50<<endl;

}

system("pause");

ماذا تحتاج من تعديل

#7

ان وجدت طريقة IF OR WHILE OR FOR

يكون افضل

لاني لااعرف طريقة المصفوفة

جزاك الله خير على كل حال

#8

// kelam.cpp : Defines the entry point for the console application.

//

#include "stdafx.h"

#include <iostream>

using namespace std;

void main ()

{

int x,z,choise;

do

{

cout<<"welcome to abo -abdo internaional company of fruits !!\n\nplz enter u r choice :\n1:apple 40s.p.\n2:orange 50s.p.\n3:tomato 35s.p.\n4:banana 55s.p.\n0:finish\nur shoice is ";

cin>>choise;

switch(choise)

{

case 0:cout<<"thnk u for coming TO US"<<endl;

break;

case 1:cout<<"u choice apple, enter wight:";cin>>x;z=40*x;cout<<endl;

break;

case 2:cout<<"u choice orange ,enter wight: ";cin>>x;z=50*x;cout<<endl;

break;

case 3:cout<<" u choice tomato , enter wight: ";cin>>x;z=35*x;cout<<endl;

break;

case 4:cout<<" u choice banana , enter wight : ";cin>>x;z=55*x;cout<<endl;

break;

default :cout<<"invalid input!"<<endl;

break;

}

}

while(choise!=0);

cout<<"u r total payment is : "<<z<<" s.p."<<endl;

system("pause");

}هذا الحل ولكن ليس كامل

عندما اعيد نفس الطلب لا يجمعها مرة اخرى

مثل ادخل تفاحة وعندما ادخلها مرة اخرى لا يضع لي المجموع فقط يعطيني ادخالها مرة واحدة

#9

ممكن تشوفى الكود هذا

نشطى الكود ين الذين بالتعليقات ﻻنهما ﻻيعملان عندى include"stdafc.h و system(pusse)

//#include "stdafx.h"
#include <iostream>
using namespace std;
int  main ()
{
    int x = 0,z = 0,choise =0;
    do
    {
        cout<<"welcome to abo -abdo internaional company of fruits !!\n\nplz enter u r choice :\n1:apple 40s.p.\n2:orange 50s.p.\n3:tomato 35s.p.\n4:banana 55s.p.\n0:finish\nur shoice is ";
        cin>>choise;
        switch(choise)
        {
        case 0:
            cout<<"thnk u for coming TO US"<<endl;
            break;
        case 1:
            cout<<"u choice apple, enter wight:";
            cin>>x;
            z+=40*x;
            cout<<endl;
            break;
        case 2:
            cout<<"u choice orange ,enter wight: ";
            cin>>x;
            z+=50*x;
            cout<<endl;
            break;
        case 3:
            cout<<" u choice tomato , enter wight: ";
            cin>>x;
            z=+35*x;
            cout<<endl;
            break;
        case 4:
            cout<<" u choice banana , enter wight : ";
            cin>>x;
            z=+55*x;
            cout<<endl;
            break;
        default :
            cout<<"invalid input!"<<endl;
            break;
        }
    }    while(choise !=0 );
    cout<<"u r total payment is : "<< z <<" s.p."<<endl;
   // system("pause");


}

post-15367-027053900%201340345097.gifpost-15367-087183200%201340344597.gif
post-247365-0-10080400-1379403554_thumb.

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