需要一些帮助添加我刚刚开始在我的课程中编程的一些功能 [英] Need Some Help Adding Some Features I Just Started Doing Programming In My Class

查看:59
本文介绍了需要一些帮助添加我刚刚开始在我的课程中编程的一些功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要修复并添加一些限制,我的食物订购系统数量最多20 1500比索最大,我需要能够输入数量,看到改变我真的菜鸟在这个编程我刚开始在我的班级,他们给了我们这个东西你也可以用一些描述你如何以及为什么使用这个声明感谢PS。我真的需要这个as



  #include   <   stdio.h  >  
#include < conio.h >

< span class =code-keyword> int main(){
// totalbilling ang数量是案例研究的变量1
float tuifee,totalfee,disinte,totalbilling;
int 模式,数量;
// 获得学费
printf( \ n 1 Burger Php10.50 \ n);
printf( \ n 2英尺长Php36.75 \ n);
printf( \ n 3 Shawarma Php62.50 \ n);
printf( \ n 4 Fries Php25.60 \ n);
printf( \ n 5 juice Php10.00 \ n);
printf( \ n 6 Shake Php15.00 \ n);
printf( \ n 7按退出);
printf( 选择1,2,3,4,5,6,7 - > );

// 显示菜单

// 获取用户的选择
printf( \ n \ n输入您的订单:);
scanf( %i,& mode);


switch (模式){
// 案例1是您订购汉堡时的实际计算(只需在必要时更改价格)
// 此案例1代码适用于所有情况,只需根据每件商品的价格更改价格
case 1

printf( 您要订购多少汉堡:);
scanf( %i,& quantity);
totalbilling = totalbilling +( 10 50 *数量);
如果(totalbilling< = 20
{

printf( 总计:%。2f,totalbilling);
}
其他 如果(totalbilling> 20 );
{
printf( 错误输入);
}
break ;

case 2

printf(< span class =code-string>
您要订购多少英尺:);
scanf( %i,& quantity);
totalbilling = totalbilling +( 36 75 *数量);
printf( 总计:%。2f,totalbilling);
break ;
case 3
printf( 您要订购多少Shawarma:);
scanf( %i,& quantity);
totalbilling = totalbilling +( 62 50 *数量);
printf( 总计:%。2f,totalbilling);
break ;
case 4

printf( 您要订购多少薯条:);
scanf( %i,& quantity);
totalbilling = totalbilling +( 25 60 *数量);
printf( 总计:%。2f,totalbilling);
break ;
case 5

printf( 您要订购多少果汁:);
scanf( %i,& quantity);
totalbilling = totalbilling +( 10 00 *数量);
printf( 总计:%。2f,totalbilling);
break ;

case 6

printf(< span class =code-string>
您要订购多少Shake:);
scanf( %i,& quantity);
totalbilling = totalbilling +( 15 00 *数量);
printf( 总计:%。2f,totalbilling);
break ;

case 7

getch() ;
break ;
默认
printf( 输入错误);
}
getch();
}

解决方案

我们不做你的功课:这是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。



亲自尝试,你可能会发现它不是和你想的一样困难!



如果遇到具体问题,请询问相关问题,我们会尽力提供帮助。但我们不打算为你做这一切!


看看 http://www.codeproject.com/Messages/5137645/Re-Programming.aspx [ ^ ],它提供了一些非常有用的提示,介绍如何在实际开始编程之前考虑问题。


< blockquote>谢谢你们,无论如何我已经完成了它我想这个问题仍然是我真的很难分解lol我仍然是一个菜鸟来到它。


need to fix and add some restriction for my food ordering system quantity max 20 1500 peso max and i need to be able to type the amount and see the change im really noob in this programming i just started in my class and they gave us this stuff can u also put some description on how and why you use that statement thanks PS. i really need this asap

#include <stdio.h>
#include <conio.h>

int main(){
//totalbilling ang quantity are variables for the case study 1
	float tuifee, totalfee, disinte, totalbilling;
	int mode, quantity;
//to get tuition fee
	printf("\n 1 Burger             Php10.50\n");
   printf("\n 2 Foot Long          Php36.75\n");
   printf("\n 3 Shawarma           Php62.50\n");
   printf("\n 4 Fries              Php25.60\n");
   printf("\n 5 juice              Php10.00\n");
   printf("\n 6 Shake              Php15.00\n");
   printf("\n 7 Press Exit");
   printf("Select 1,2,3,4,5,6,7-->");

//display menu

//get the user's choice
	printf("\n\nEnter your order: ");
	scanf("%i", &mode);


switch(mode){
//case 1 is the actual computation when you order burger (just change the price if necessary)
//This case 1 code applies to all cases just change the price depending on the price given per item
	case 1:

        printf("How many Burger you want to order: ");
        scanf("%i", &quantity);
        totalbilling=totalbilling+(10.50*quantity);
        if(totalbilling<=20)
        {

         printf("Total: %.2f", totalbilling);
         }
        else if(totalbilling > 20);
        {
         printf("wrong inpute");
        }
        break;

	case 2:

        printf("How many Foot Long you want to order: ");
        scanf("%i", &quantity);
        totalbilling=totalbilling+(36.75*quantity);
        printf("Total: %.2f", totalbilling);
		  break;
	case 3:
		  printf("How many Shawarma you want to order: ");
        scanf("%i", &quantity);
        totalbilling=totalbilling+(62.50*quantity);
        printf("Total: %.2f", totalbilling);
		  break;
	case 4:

        printf("How many Fries you want to order: ");
        scanf("%i", &quantity);
        totalbilling=totalbilling+(25.60*quantity);
        printf("Total: %.2f", totalbilling);
      break;
   case 5:

        printf("How many Juice you want to order: ");
        scanf("%i", &quantity);
        totalbilling=totalbilling+(10.00*quantity);
        printf("Total: %.2f", totalbilling);
        break;

   case 6:

   	  printf("How many Shake you want to order: ");
        scanf("%i", &quantity);
        totalbilling=totalbilling+(15.00*quantity);
        printf("Total: %.2f", totalbilling);
        break;

   case 7:

		getch();
		break;
		default:
		printf("wrong input");
}
getch();
}

解决方案

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!


Have a look at http://www.codeproject.com/Messages/5137645/Re-Programming.aspx[^], it gives some very useful tips about how to think about the problem before you actually start programming.


thanks guys anyway i finished it already i guess the problem still is that im really bad at breaking down lol again im still a noob with it comes to this.


这篇关于需要一些帮助添加我刚刚开始在我的课程中编程的一些功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆