abilerim kardeşlerim sizden acele yardım bekliyorum

Başlatan berkay55, 10 Aralık 2010, 20:41:00

« önceki - sonraki »

berkay55

programcılıkla uğraşan ve c ye karşı ilgisi olan arkadaşlar varsa bi proje var 2 arkadas birlikte yazdık hoca kopya muamelesi yapıyormuş aynı yollayınca anlayan bi arkadas varsa biraz değişiklik yapabilir mi anlayan çıkarsa çok mutlu olurum bu proje 2.vize yerine geçecek  code bu gece 12 ye kadar bir iki değişiklik yapmam gerekiyor yardımcı olursanız çok mutlu olurum şimdiden teşekkürler

/*
cmpe1401 fall2010 project 2
Description: A program that graphs a wide range of shapes
(square, diamond, isosceles triangle, isosceles right triangle, hollow square, hour glass),
in desired sizes using user-defined characters.Student no: 999999
*/


#include<stdio.h>



      void square(int size,char character){//square function
           int i;
           int j;
           
           for (i=1; i<=size; i++){
               for (j=1; j<=size; j++){
                   printf("%c",character);
               }
                   printf("\n");
           }
      }
     
     
     
     
      void isosceles_triangle(int size,char character){//isosceles triangle function       
               
               int i;
               int j;
               int k;                 
               
               for (i=1; i<=size; i++){
                  for (j=1; j<=size-i; j++){
                     printf(" ");
                  }
      
                   for(k=1;k<=2*i-1;k++){
                       printf("%c",character);
                   }
                     printf("\n");
               }
       }
       
       
       void isosceles_right_triangle (int size,char character){//isosceles right triangle function
            int i;
            int j;
           
           
            for (i=1; i<=size; i++){
                  for (j=1; j<=i; j++){
                       printf("%c",character);
                  }
                  
                      printf("\n");
                   
            }
                     

       }
       
       void diamond(int size,char character){//diamond function   
            int i;
            int j;
            int k;
           
              for (i=1; i<=size; i++){
               for (j=1; j<=size-i; j++){
                   printf(" ");
                }
      
              for(k=1;k<=2*i-1;k++){
                    printf("%c",character);
              }
         
         
              printf("\n");
      
           }
   
           //-----

   
           for (i=1; i<=size-1; i++){
               for (j=1; j<=i; j++){
                 printf(" ");
               }
      
              for(k=1;k<=(2*size-1)-(2*i);k++){
                     printf("%c",character);
              }
      
              printf("\n");
      
            }
      }
     
     
     
     
       void hour_glass(int size,char character){//hour glass function
            int i;
            int j;
            int k;
   
           for (i=0; i<=size-2; i++){
               for (j=1; j<=i; j++){
                 printf(" ");
               }
      
              for(k=1;k<=(2*size-1)-(2*i);k++){
                     printf("%c",character);
              }
      
              printf("\n");
      
            }
           
            //------
           
           
            for (i=1; i<=size; i++){
               for (j=1; j<=size-i; j++){
                   printf(" ");
                }
      
              for(k=1;k<=2*i-1;k++){
                    printf("%c",character);
              }
         
         
              printf("\n");
      
           }
           
           
           
      }
     
      void hollow_square(int size,char character){//hollow square function
     
           int i;
           int j;
           int k;
           
           
           for (i=1; i<=size; i++)
          {
              if(i==1||i==size){
                    for (j=1; j<=size; j++){
                  
                    printf("%c ",character);   
                  
                    }
                  printf("\n");
               }
                 else{
                   printf("%c",character);
                            for(k=1;k<=2*size-3;k++){
                         printf(" ");
                         }
                         printf("%c",character);
                         printf("\n");
            }
            }
             
      }





int main()
{
    int size;
    char character;
    int choose;
    char answer;
   
   
   
    do{
   
    printf("Enter a character and size:");//asks for the character and size of shape
    scanf(" %c %d",&character,&size);
   
    printf("Choose the shape to graph\n");
    printf("1 for square\n");
    printf("2 for diamond\n");
    printf("3 for isosceles triangle\n");
    printf("4 for isosceles right triangle\n");
    printf("5 for hollow square\n");
    printf("6 for hour glass\n");
    printf("?");
    scanf(" %d",&choose);//choose the shape
   
   
    switch(choose){//takes the type of shape and goes to function
                  case 1:       
                       
                       square(size,character);   
                 
                  break;
                 
                  case 2:       
                       
                       diamond(size,character);   
                       
                  break;
                 
                  case 3:       
                       
                       isosceles_triangle(size,character);     
                       
                  break;
                 
                  case 4:       
                       
                       isosceles_right_triangle(size,character);     
                       
                  break;
                 
                  case 5:
                 
                       hollow_square(size,character);
                       
                  break;
                 
                 
                  case 6:
                       
                       hour_glass(size,character);
                       
                  break; 
                       
                         
   }
   
   
    printf("If you want to continue press enter 'y':");//asks wheter the user wants to continue
    scanf(" %c",&answer);
   
    printf("\n\n\n");
   
    }while(answer=='y');
             
}

berkay55

Drawing Shapes with Characters: Write a C program that graphs a wide range of shapes
(square, diamond, isosceles triangle, isosceles right triangle, hollow square, hour glass (kum
saati)), in desired sizes using user-defined characters as follows:
At the beginning of your program, you need to ask the user, which character he/she wants to
use to draw a shape. Secondly, you need to ask the size of a shape (line number). Use these
information in your functions.
- You need to use functions.
- You need to use switch.
- Use do-while to check if the user wants to continue drawing shapes
bu da konusuu

maço

kardesım for dongulerını while ya da do while dongulerı olarak degıstırırsen

bıde degıskenlerı degıstırırsen sana kopya muamelesı yapamaz ;)

Tufan

programlama hiç kafamın basmadığı bir olay hatta geçen dönem kaldım c c++ dan.
çok zor bi koda benzemiyor umarım halledersin.

AntZ

Alıntı yapılan: maço - 10 Aralık 2010, 20:44:36
kardesım for dongulerını while ya da do while dongulerı olarak degıstırırsen

bıde degıskenlerı degıstırırsen sana kopya muamelesı yapamaz ;)


+

// ile başlayan açıklamaları değiştir

 printf("Choose the shape to graph\n");
   printf("1 for square\n");
   printf("2 for diamond\n");
   printf("3 for isosceles triangle\n");
...
   printf("?");

yerine

 printf("Sekil seciniz\n");
   printf("1 kare\n");
   printf("2 elmas\n");
   printf("3 ikizkenar dortgen\n");
...
   printf("?");

yap ve menü yerlerini değiştir

***

i,j,k yerine sırasıyla say1, say2, say3 kullan


***

void ile başlayan fonksiyonların yerlerini değiştir

***

Üstteki açıklamayı aşağıdakiyle değiştir

/*

Girilen boyutta, girilen karakterle seçilen şekli çizdirme programı...
Hazırlayan: Berkay ... Öğr. No: 99999

*/

erkutdem55


lucarelli


AntZ

Alıntı yapılan: erkutdem55 - 10 Aralık 2010, 20:55:30
Bu site her türlü koptu gitti resmen ya


<%if this_site="koptu" then
response.redirect("kopmayan_site")
else
response.write(":)")
end if
%>

berkay55

ilginize teşekkür ederim geçen dönem kaldım bu dönemde kalmamak için çabalıyorum  ;D

erkutdem55

Alıntı yapılan: Ant55 - 10 Aralık 2010, 21:17:36
<%if this_site="koptu" then
response.redirect("kopmayan_site")
else
response.write(":)")
end if
%>



Ben de senin Murat kardeşim :)))))
Ben word ve excel biliyorum,beni işe alır mısın :)))))

AntZ


berkay55

yönetici abilerim konuyu silebilirz ant55,maço ve diğer arkadaşların yardımıyla hallettim işimi çok sağolun

kalptenþimþek


mehmet yılmaz

Bunlar ne ula? Sitede küfür etmek yasak!!!!

:P 8) :D ;D :-* samsunspor_x

berkay55