نمایش نتایج 1 تا 40 از 320

نام تاپیک: مجموعه برنامه های نوشته شده به زبان C و ++C

Hybrid View

پست قبلی پست قبلی   پست بعدی پست بعدی
  1. #1

    نقل قول: مجموعه برنامه های نوشته شده به زبان C و ++C

    نقل قول نوشته شده توسط Nima_NF مشاهده تاپیک
    کاربران از این به بعد می توانند در این تاپیک سورس کدهای برنامه های خود را قرار دهند تا مجموعه ای مفید از برنامه ها ایجاد شود و همگان بتوانند از آن استفاده کنند.
    سورس کدهای کوچک، کاربردی و متداول (مثلا نحوه ایجاد آرایه n بعدی!) نیز مجاز است.

    لذا قبل از ارسال پستی در این تاپیک رعایت همه قوانین زیر ضروری است، در غیر این صورت هرچند که ارسال شما مفید باشد بدون تذکر پاک می شود:

    1- (مهم) قرار دادن تمرینات و پروژه هایی که بیشتر دانشجویی هستند و معمولا کاربرد دیگری جز دریافت نمره ندارند ممنوع است. (تحت هر عنوانی، حال یادگیری یا آموزش) سایر مواردی که کاربردی هستند یا فقط دانشجویی نیستند و در برنامه های تجاری نیز به کار خواهند آمد مجاز می باشد.

    2- درخواست برنامه در این تاپیک ممنوع است. فقط قرار دادن سورس کد برنامه مجاز است.

    3- برنامه حتما باید شامل سورس کد باشد، فایل اجرایی به تنهایی حذف خواهد شد.
    نکته: در صورتی که کدها کوتاه است به صورت مستقیم قرار دهید، در غیر این صورت به صورت فایل zip

    4- در صورتی که سورس کدی از سایتی کپی می شود کپی رایت باید ذکر شود و حتما مرجع آن نیز ذکر شود.


    5- قرار دادن سورس کدهای تجاری که مالکیت آن برای فرد دیگری هست (طبق قوانین کلی سایت) ممنوع می باشد.

    6- عنوان مناسب و مجزا از سایر توضیحات برای هر برنامه انتخاب کنید تا کاربران به راحتی برنامه مورد نظر خود را بیابند. تا جای ممکن برای عناوین از حالت Bold استفاده کنید.


    موفق باشید
    ******سلام
    وقت بخیر من یه برنامه ای نوشتم احتیاج به ادیت داره شما میتونید ادیتش کنید
    ممنون

  2. #2

    نقل قول: مجموعه برنامه های نوشته شده به زبان C و ++C

    دومیش

    #include <stdio.h>
    #include <stdlib.h>
    #include<conio.h>
    #include<string.h>
    #include <ctype.h>
    int menu_select();
    int del_houses(struct house *houseList, int houseCount);
    #define MAX 100
    struct house
    {
    int status;
    float cost;
    float groundArea;
    float infrastructureArea;
    int rooms;
    };
    char type[][20] = { "rent","mortage","sale","rent\\mortage" };
    int main(void){
    struct house houseList[MAX];
    int houseCount=0,i=0,q=0,choice=0,exit=0,del=0,edit=0;
    float rep=0;
    char type[][20]={"rent","mortage","sale","rent\\mortage"};
    for(i=0;exit==0;i++){
    printf("1<<add>>\n");
    printf("2<<delet>>\n");
    printf("3<<edit>>\n");
    printf("4<<report>>\n");
    printf("5<<exit>>\n");
    printf("**************************\n");


    do {
    printf("please enter your choice(1_5)\n");
    do
    {
    memset(s, 0, sizeof(s));
    gets(s);
    }
    while (!isdigit(s[0]));
    c = atoi(s);
    } while (c<1 || c>5);
    return c;
    scanf("%d",&choice);
    switch(choice){
    case 1:
    printf("Enter ground area:");
    scanf("%f",&houseList[houseCount].groundArea);

    printf("Enter infrastructure area:");
    scanf("%f",&houseList[houseCount].infrastructureArea);

    printf("Enter number of rooms:");
    scanf("%d",&houseList[houseCount].rooms);

    printf("Enter cost:");
    scanf("%f",&houseList[houseCount].cost);

    do{
    printf("\n**************************************** \n");
    printf("enter house type:\n");
    printf("\t1 <for rent>\n");
    printf("\t2 <for mortage>\n");
    printf("\t3 <for sale>\n");
    printf("\t4 <for rent and mortage>\n");
    scanf("%d",&houseList[houseCount].status);
    if(houseList[houseCount].status<0 || houseList[houseCount].status>4 ){
    printf("Invalid Input\nEnter valid input\n");
    }
    else{
    q=1;
    }
    }
    while(q==0);
    houseCount++;

    break;
    case 2:
    int del_houses();


    break;
    case 3:

    printf("%5s%15s%12s%12s%5s%8s\n","** ID **","** Type **","** Grd Area **","** Inf Area **","** rooms **","** Cost **");
    for(int m=0;m<houseCount;m++){
    printf("%5d%15s%12.2f%12.2f%8d%8.2f\n",m+1,type[(houseList[m].status)-1],houseList[m].groundArea,houseList[m].infrastructureArea,houseList[m].rooms,houseList[m].cost);
    }
    do{
    printf("****************************************** ***\n");
    printf("Enter the ID number you want to Edit:");
    scanf("%d",&del);
    if(del<=0 || del>houseCount+1){
    printf("Invalid Id Number\nPlease Enter Valid ID number\n");
    }
    }
    while(del<=0 || del>houseCount+1);

    printf("Enter ground area:");
    scanf("%f",&houseList[del-1].groundArea);

    printf("Enter infrastructure area:");
    scanf("%f",&houseList[del-1].infrastructureArea);

    printf("Enter number of rooms:");
    scanf("%d",&houseList[del-1].rooms);

    printf("Enter cost:");
    scanf("%f",&houseList[del-1].cost);

    printf("Enter house type:\n\t\t1 for rent\n\t\t2 for mortage\n\t\t3 for sale\n\t\t4 for rent and mortage\n");
    scanf("%d",&houseList[del-1].status);
    break;
    case 4:
    int menu_select()
    break;

    }
    return 0;
    }
    int menu_select()
    {
    char p[10], ch;
    int i = 0, del = 0;
    float rep = 0;
    printf("1<<all>>\n");
    printf("2<<by size>>\n");
    printf("3<<by status>>\n");
    printf("4<<by cost>>\n");
    printf("5<<by room>>\n");
    printf("6<<Back>>\n");
    printf("************************");
    printf("please enter your choice(1_6):\n");
    gets(p);
    del = atoi(p);
    switch (del) {
    case 1:
    for (int m = 0; m<houseCount; m++) {
    printf("%5d%15s%12.2f%12.2f%8d%8.2f\n", m + 1, type[(houseList[m].status) - 1], houseList[m].groundArea, houseList[m].infrastructureArea, houseList[m].rooms, houseList[m].cost);
    }
    break;
    case 2:
    printf("Enter the size of house to print the list\n");
    scanf("%f", &rep);
    printf("%5s%15s%12s%12s%5s%8s\n", "** ID **", "** Type **", "** Grd Area **", "** Inf Area **", "** rooms **", "** Cost **");


    for (int m = 0; m<houseCount; m++) {
    if (houseList[m].groundArea >= rep) {
    printf("%5d%15s%12.2f%12.2f%8d%8.2f\n", m + 1, type[(houseList[m].status) - 1], houseList[m].groundArea, houseList[m].infrastructureArea, houseList[m].rooms, houseList[m].cost);
    }
    }
    break;
    case 3:
    printf("Enter the status of house to print the list\n");
    while (1)
    {
    scanf("%f", &rep);
    if (rep >= 1 || rep <= 4)
    break;
    }



    for (int m = 0; m<houseCount; m++) {
    if (houseList[m].status == (int)rep) {
    printf("%5d%15s%12.2f%12.2f%8d%8.2f\n", m + 1, type[(houseList[m].status) - 1], houseList[m].groundArea, houseList[m].infrastructureArea, houseList[m].rooms, houseList[m].cost);
    }
    }
    break;
    case 4:
    printf("Enter the cost of house to print the list\n");
    scanf("%f", &rep);
    printf("%5s%15s%12s%12s%5s%8s\n", "** ID **", "** Type **", "** Grd Area **", "** Inf Area **", "** rooms **", "** Cost **");
    for (int m = 0; m<houseCount; m++) {
    if (houseList[m].cost <= rep) {
    printf("%5d%15s%12.2f%12.2f%8d%8.2f\n", m + 1, type[(houseList[m].status) - 1], houseList[m].groundArea, houseList[m].infrastructureArea, houseList[m].rooms, houseList[m].cost);
    }
    }
    break;
    case 5:
    printf("Enter the number of rooms of house to print the list\n");
    scanf("%f", &rep);
    printf("%5s%15s%12s%12s%5s%8s\n", "** ID **", "** Type **", "** Grd Area **", "** Inf Area **", "** rooms **", "** Cost **");


    for (int m = 0; m<houseCount; m++) {
    if (houseList[m].rooms == (int)rep) {
    printf("%5d%15s%12.2f%12.2f%8d%8.2f\n", m + 1, type[(houseList[m].status) - 1], houseList[m].groundArea, houseList[m].infrastructureArea, houseList[m].rooms, houseList[m].cost);
    }
    }
    break;
    case 6:


    break;
    default:
    printf("Invalid Input\n");
    }
    }
    int del_houses(struct house *houseList, int houseCount)
    {
    struct house houseList[MAX];
    int houseCount=0,i=0,q=0,choice=0,exit=0,del=0,edit=0;
    float rep=0;
    char type[][20]={"rent","mortage","sale","rent\\mortage"};
    printf("\n**************************************** **************\n");
    printf("%5s%15s%12s%12s%5s%8s\n","** ID **","** Type **","** Grd Area **","** Inf Area **","** rooms **","** Cost **");
    printf("\n**************************************** **************\n");
    for(int m=0;m<houseCount;m++){
    printf("%5d%15s%12.2f%12.2f%8d%8.2f\n",m+1,type[(houseList[m].status)-1],houseList[m].groundArea,houseList[m].infrastructureArea,houseList[m].rooms,houseList[m].cost);
    }
    do{
    printf("Enter the ID number you want to delete:");
    scanf("%d",&del);
    if(del<=0 || del>houseCount+1){
    printf("****************************************** *****\n");
    printf("Invalid Id Number\nPlease Enter Valid ID number\n");
    }
    }
    while(del<=0 || del>houseCount+1);
    for(int m=del-1;m<houseCount;m++){
    houseList[m].cost=houseList[m+1].cost;
    houseList[m].groundArea=houseList[m+1].groundArea;
    houseList[m].infrastructureArea=houseList[m+1].infrastructureArea;
    houseList[m].rooms=houseList[m+1].rooms;
    houseList[m].status=houseList[m+1].status;
    }
    houseCount--;
    }















































  3. #3

    نقل قول: مجموعه برنامه های نوشته شده به زبان C و ++C

    این برنامه مشکل داره باید ادیت بش
    #include <stdio.h>
    #include <stdlib.h>
    #include<conio.h>
    #include<string.h>
    #include <ctype.h>
    #define MAX 100
    int menu_select();
    int add_house(struct house *houseList, int houseCount);
    int edit_house(struct house *houseList, int houseCount);
    int add_house(struct house *houseList, int houseCount);
    struct house
    {
    int status;
    float cost;
    float groundArea;
    float infrastructureArea;
    int rooms;
    };
    char type[][20] = { "rent","mortage","sale","rent\\mortage" };
    int main(void)
    {
    struct house houseList[MAX];
    int houseCount=0,i=0,q=0,choice=0,exit=0,del=0,edit=0;
    float rep=0;
    char type[][20]={"rent","mortage","sale","rent\\mortage"};
    for(i=0;exit==0;i++){
    choice=menu_select();
    scanf("%d",&choice);
    switch (choice) {
    case 1:
    int add_house(struct house *houseList, int houseCount);

    do {
    printf("\n**************************************** \n");
    printf("Enter house type:\n\t\t1 for rent\n\t\t2 for mortage\n\t\t3 for sale\n\t\t4 for rent and mortage\n");
    scanf("%d", &houseList[houseCount].status);
    if (houseList[houseCount].status < 1 || houseList[houseCount].status>4) {
    printf("Invalid Input\nEnter valid input\n");
    }
    else {
    q = 1;
    }
    } while (q == 0);
    houseCount++;


    break;
    case 2:
    printf("\n**************************************** **************\n");
    printf("%5s%15s%12s%12s%5s%8s\n","** ID **","** Type **","** Grd Area **","** Inf Area **","** rooms **","** Cost **");
    printf("\n**************************************** **************\n");
    for(int m=0;m<houseCount;m++){
    printf("%5d%15s%12.2f%12.2f%8d%8.2f\n",m+1,type[(houseList[m].status)-1],houseList[m].groundArea,houseList[m].infrastructureArea,houseList[m].rooms,houseList[m].cost);
    }
    do{
    printf("Enter the ID number you want to delete:");
    scanf("%d",&del);
    if(del<=0 || del>houseCount+1){
    printf("****************************************** *****\n");
    printf("Invalid Id Number\nPlease Enter Valid ID number\n");
    }
    }
    while(del<=0 || del>houseCount+1);
    for(int m=del-1;m<houseCount;m++){
    houseList[m].cost=houseList[m+1].cost;
    houseList[m].groundArea=houseList[m+1].groundArea;
    houseList[m].infrastructureArea=houseList[m+1].infrastructureArea;
    houseList[m].rooms=houseList[m+1].rooms;
    houseList[m].status=houseList[m+1].status;
    }
    houseCount--;
    break;
    case 3:
    int edit_house(struct house *houseList, int houseCount);


    break;
    case 4:
    printf("****************************************** *****\n");
    printf("1.All\n2.By size\n3.by status\n4.by cost\n5.by room\n6.back\n");
    scanf("%d",&del);
    do{
    switch(del){
    case 1:
    for(int m=0;m<houseCount;m++){
    printf("%5d%15s%12.2f%12.2f%8d%8.2f\n",m+1,type[(houseList[m].status)-1],houseList[m].groundArea,houseList[m].infrastructureArea,houseList[m].rooms,houseList[m].cost);
    }
    break;
    case 2:
    printf("Enter the size of house to print the list\n");
    scanf("%f",&rep);
    printf("%5s%15s%12s%12s%5s%8s\n","** ID **","** Type **","** Grd Area **","** Inf Area **","** rooms **","** Cost **");

    for(int m=0;m<houseCount;m++){
    if(houseList[m].groundArea>=rep){
    printf("%5d%15s%12.2f%12.2f%8d%8.2f\n",m+1,type[(houseList[m].status)-1],houseList[m].groundArea,houseList[m].infrastructureArea,houseList[m].rooms,houseList[m].cost);
    }
    }
    break;
    case 3:
    printf("Enter the status of house to print the list\n");
    scanf("%f",&rep);
    q=0;
    do{
    printf("Enter house type:\n\t\t1 for rent\n\t\t2 for mortage\n\t\t3 for sale\n\t\t4 for rent and mortage\n");
    scanf("%d",&houseList[houseCount].status);
    if(houseList[houseCount].status<0 || houseList[houseCount].status>4 ){
    printf("Invalid Input\nEnter valid input\n");
    }
    else{
    q=1;
    }
    }
    while(q==0);

    for(int m=0;m<houseCount;m++){
    if(houseList[m].status==(int)rep){
    printf("%5d%15s%12.2f%12.2f%8d%8.2f\n",m+1,type[(houseList[m].status)-1],houseList[m].groundArea,houseList[m].infrastructureArea,houseList[m].rooms,houseList[m].cost);
    }
    }
    break;
    case 4:
    printf("Enter the cost of house to print the list\n");
    scanf("%f",&rep);
    printf("%5s%15s%12s%12s%5s%8s\n","** ID **","** Type **","** Grd Area **","** Inf Area **","** rooms **","** Cost **");
    for(int m=0;m<houseCount;m++){
    if(houseList[m].cost<=rep){
    printf("%5d%15s%12.2f%12.2f%8d%8.2f\n",m+1,type[(houseList[m].status)-1],houseList[m].groundArea,houseList[m].infrastructureArea,houseList[m].rooms,houseList[m].cost);
    }
    }
    break;
    case 5:
    printf("Enter the number of rooms of house to print the list\n");
    scanf("%f",&rep);
    printf("%5s%15s%12s%12s%5s%8s\n","** ID **","** Type **","** Grd Area **","** Inf Area **","** rooms **","** Cost **");

    for(int m=0;m<houseCount;m++){
    if(houseList[m].rooms==(int)rep){
    printf("%5d%15s%12.2f%12.2f%8d%8.2f\n",m+1,type[(houseList[m].status)-1],houseList[m].groundArea,houseList[m].infrastructureArea,houseList[m].rooms,houseList[m].cost);
    }
    }
    break;
    break;
    case 6:

    break;
    default:
    printf("Invalid Input\n");
    }
    }
    while(del <0 && del >6);
    break;
    default:
    printf("Invalid Input\n");
    }

    }
    return 0;
    }


    int menu_select()
    {
    char s[10];
    int i = 0, c = 0;
    printf("1<<add>>\n");
    printf("2<<delet>>\n");
    printf("3<<edit>>\n");
    printf("4<<report>>\n");
    printf("5<<exit>>\n");
    printf("**************************\n");


    do {
    printf("please enter your choice(1_5)\n");
    do
    {
    memset(s, 0, sizeof(s));
    gets(s);
    }
    while (!isdigit(s[0]));
    c = atoi(s);
    } while (c<1 || c>5);
    return c;
    }
    int add_house(struct house *houseList, int houseCount);
    {
    struct house houseList[MAX];
    int houseCount=0,i=0,q=0,choice=0,exit=0,del=0,edit=0;
    float rep=0;
    char type[][20]={"rent","mortage","sale","rent\\mortage"};
    printf("Enter ground area:");
    scanf("%f",&houseList[houseCount].groundArea);

    printf("Enter infrastructure area:");
    scanf("%f",&houseList[houseCount].infrastructureArea);

    printf("Enter number of rooms:");
    scanf("%d",&houseList[houseCount].rooms);

    printf("Enter cost:");
    scanf("%f",&houseList[houseCount].cost);

    do{
    printf("\n**************************************** \n");
    printf("Enter house type:\n\t\t1 for rent\n\t\t2 for mortage\n\t\t3 for sale\n\t\t4 for rent and mortage\n");
    scanf("%d",&houseList[houseCount].status);
    if(houseList[houseCount].status<0 || houseList[houseCount].status>4 ){
    printf("Invalid Input\nEnter valid input\n");
    }
    else{
    q=1;
    }
    }
    while(q==0);
    houseCount++;

    }












    int edit_house(struct house *houseList, int houseCount);
    {
    struct house houseList[MAX];
    int houseCount=0,i=0,q=0,choice=0,exit=0,del=0,edit=0;
    float rep=0;
    char type[][20]={"rent","mortage","sale","rent\\mortage"};
    printf("%5s%15s%12s%12s%5s%8s\n", "** ID **", "** Type **", "** Grd Area **", "** Inf Area **", "** rooms **", "** Cost **");
    for (int m = 0; m < houseCount; m++) {
    printf("%5d%15s%12.2f%12.2f%8d%8.2f\n", m + 1, type[(houseList[m].status) - 1], houseList[m].groundArea, houseList[m].infrastructureArea, houseList[m].rooms, houseList[m].cost);

    do {
    printf("****************************************** ***\n");
    printf("Enter the ID number you want to Edit:");
    scanf("%d", &del);
    if (del <= 0 || del > houseCount + 1) {
    printf("Invalid Id Number\nPlease Enter Valid ID number\n");
    }
    } while (del <= 0 || del > houseCount + 1);


    printf("Enter ground area:");
    scanf("%f", &houseList[del - 1].groundArea);


    printf("Enter infrastructure area:");
    scanf("%f", &houseList[del - 1].infrastructureArea);


    printf("Enter number of rooms:");
    scanf("%d", &houseList[del - 1].rooms);


    printf("Enter cost:");
    scanf("%f", &houseList[del - 1].cost);


    printf("Enter house type:\n\t\t1 for rent\n\t\t2 for mortage\n\t\t3 for sale\n\t\t4 for rent and mortage\n");
    scanf("%d", &houseList[del - 1].status);
    }
    آخرین ویرایش به وسیله .Writer. : پنج شنبه 25 خرداد 1396 در 14:20 عصر

  4. #4

    نقل قول: مجموعه برنامه های نوشته شده به زبان C و ++C

    چه برنامه ای هستن؟

  5. #5

    نقل قول: مجموعه برنامه های نوشته شده به زبان C و ++C

    همون سه تایی که بالا نوشتم مدیریت املاک
    خود متن برنامه رو هم بفرستم؟؟؟

  6. #6

    نقل قول: مجموعه برنامه های نوشته شده به زبان C و ++C

    این سه تا مشکل دارن باید ادیت بشن

برچسب های این تاپیک

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •