อยากให้มันเลือกสินค้าแล้วเอาราคามาบวกกันได้อะครับ
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void main(void)
{
char ans;
do{
clrscr();
gotoxy(1,1);
textcolor(14);
textbackground(8);
cprintf("Computer Hardware Stores\n");
gotoxy(1,3);
textcolor(12);
textbackground(8);
cprintf("Please Select 1-7\n");
gotoxy(1,4);
textcolor(9);
textbackground(8);
cprintf("1.Computer\n");
gotoxy(1,5);
textcolor(9);
textbackground(8);
cprintf("2.CPU\n");
gotoxy(1,6);
textcolor(9);
textbackground(8);
cprintf("3.Mainboard\n");
gotoxy(1,7);
textcolor(9);
textbackground(8);
cprintf("4.Monitor\n");
gotoxy(1,8);
textcolor(9);
textbackground(8);
cprintf("5.Printer\n");
gotoxy(1,9);
textcolor(9);
textbackground(8);
cprintf("6.Flash Drive\n");
gotoxy(1,10);
textcolor(9);
textbackground(8);
cprintf("7.Gaming Gear\n");
gotoxy(1,11);
textcolor(9);
textbackground(8);
cprintf(" Select : ");
ans=getche();
printf("\n");
switch(ans){
case'1': clrscr();
printf("Computer\n\n");
printf("1. DESKTOP PC ACER ASPIRE TC-710-644G1T00MGI/T003\n");
printf("CPU-INTEL CORE I5-6400 RAM : 4 GB\n");
printf("HDD : 1 TB VGA : GT 730 OS : DOS 18,900 THB\n\n");
printf("2. DESKTOP PC ACER ASPIRE TC-710-644G1T00MI/T008\n");
printf("CPU : INTEL CORE I5-6400 RAM : 4 GB\n");
printf("HDD : 1 TB VGA : INTEL HD GRAPHICS OS : DOS 15,990 THB\n\n");
printf("3. DESKTOP PC ACER ASPIRE TC704-314G5000MI\n");
printf("CPU : INTEL CELERON N3150 RAM : 4 GB\n");
printf("HDD : 500 GB VGA : INTEL HD GRAPHICS OS : DOS 8,990 THB\n\n");
printf("4. DESKTOP PC ACER ASPIRE TC704-374G1T00MI\n");
printf("CPU : INTEL PENTIUM J3710D RAM : 4 GB\n");
printf("HDD : 1 TB VGA : UMA OS : DOS 10,990 THB\n\n");
printf("5. DESKTOP PC ACER PREDATOR G3-710-648G1T00MGI\n");
printf("CPU : INTEL CORE I5-6400 RAM : 8 GB\n");
printf("HDD : 1 TB VGA : GTX 950 2GB OS : WINDOWS 10 38,900 THB\n");
break;
case'2' :clrscr();
printf("CPU\n\n");
printf("CPU AMD AM3+ FX-4300 3.8 GHz\n");
printf("CORES : 4 THREADS : 4 3,590 THB\n\n");
printf("CPU AMD AM3+ FX-4350 3.6 GHz\n");
printf("CORES : 4 THREADS : 4 3,930 THB\n\n");
printf("CPU AMD AM3+ FX-8370 4.0 GHz\n");
printf("CORES : 8 THREADS : 8 7,590 THB\n\n");
printf("CPU AMD AM3+ FX-9370 4.4 GHz\n");
printf("CORES : 8 THREADS : 8 7,790 THB\n\n");
break;
case'3' :clrscr();
printf("Mainboard\n\n");
printf("MAINBOARD AM3+ ASROCK 960GM-VGS3 FX\n");
printf("SOCKET : AM3+ CHIPSET : AMD 760G / AMD SB710\n");
printf("MEMORY : 2 x DDR3 DIMM 1,390 THB\n\n");
printf("MAINBOARD AM3+ ASROCK 970 EXTREME3 (REV2)\n");
printf("SOCKET : AM3+ CHIPSET : AMD 970 / AMD SB950\n");
printf("MEMORY : 4 x DDR3 DIMM 2,750 THB\n\n");
printf("MAINBOARD AM3+ MSI 990FXA GAMING\n");
printf("SOCKET : AM3+ CHIPSET : AMD 990FX & SB950\n");
printf("MEMORY : 4 x DDR3 DIMM 4,890 THB\n\n");
printf("MAINBOARD AM3+ GIGABYTE 990FX GAMING\n");
printf("SOCKET : AM3+ CHIPSET : AMD 990F/ SB950\n");
printf("MEMORY : 4 x DDR3 DIMM 5,190 THB\n\n");
break;
case'4' :clrscr();
printf("Monitor\n\n");
printf("18.5"" LED SAMSUNG LS19F350HNEXXT\n");
printf("SIZE : 18.5"" CONTRAST : MEGA RESPONSE\n");
printf("TIME : 14 ms 2,790 THB\n\n");
printf("24"" LED SAMSUNG LS24F350FHEXXT\n");
printf("SIZE : 24"" CONTRAST : 1000 : 1 RESPONSE\n");
printf("TIME : 4 (GTG) 4,690 THB\n\n");
printf("MONITOR 27 SAMSUNG LC27F390FHEXXT\n");
printf("SIZE : 27"" CONTRAST : 3000:1 RESPONSE\n");
printf("TIME : 4 ms 12,900 THB\n\n");
printf("34"" UHD SAMSUNG 34E790CNS/XT (CURVED)\n");
printf("SIZE : 34"" CONTRAST : 3000:1 RESPONSE\n");
printf("TIME : 4 (GTG) ms 31,900 THB\n\n");
break;
case'5' :clrscr();
printf("Printer\n\n");
printf("PRINTER RICOH SP 211 LASER\n");
printf("MONO LASER : PRINT 1,990 THB\n\n");
printf("PRINTER RICOH SP C240DN LASER COLOR\n");
printf("COLOR LASER : PRINT 4,690 THB\n\n");
printf("PRINTER RICOH SP C250DN LASER COLOR\n");
printf("COLOR LASER : PRINT/WIFI 5,990 THB\n\n");
printf("PRINTER RICOH SP C250SF LASER COLOR ALL IN ONE\n");
printf("COLOR INKJET : PRINT/SCAN/COPY/FAX/WIFI 15,990 THB\n\n");
break;
case'6' :clrscr();
printf("Flash Drive\n\n");
printf("8 GB FLASH DRIVE KINGSTON SE9 (DTSE9H/8GB)\n");
printf("CAPACITY : 8 GB \n");
printf("READ SPEED : 10 MB/s WRITE SPEED : 5 MB/s 130 THB\n\n");
printf("16 GB FLASH DRIVE KINGSTON (DTDUO3C/16GB)\n");
printf("CAPACITY : 16 GB \n");
printf("SPEED : 100 MB/s WRITE READ SPEED : 15 MB/s 330 THB\n\n");
printf("32 GB FLASH DRIVE KINGSTON (DTDUO3C/32GB)\n");
printf("CAPACITY : 32 GB READ SPEED : 100 MB/s\n");
printf("WRITE SPEED : 15 MB/s 450 THB\n\n");
printf("64 GB FLASH DRIVE KINGSTON (DTIG4/64GBFR) USB 3.1\n");
printf("CAPACITY : 64 GB READ SPEED : N/A WRITE SPEED : N/A 560 THB\n\n");
break;
case'7' :clrscr();
printf("Gaming Gear\n\n\n");
printf("Keyborad\n\n");
printf("KEYBOARD ASUS CERBERUS\n");
printf("FEATURES : RUBBER DOME 1,290 THB\n\n");
printf("KEYBOARD ASUS CERBERUS WHITE\n");
printf("FEATURES : MEMBRANE WITH RUBBER DOME 1,690 THB\n\n");
printf("Mouse\n\n\n");
printf("MOUSE ASUS CERBERUS\n");
printf("OPTICAL SENSOR : 2500");
printf("DPI SUPPORT : PC WITH USB PORT 690 THB\n\n");
printf("MOUSE ASUS ROG GLADIUS\n");
printf("OPTICAL SENSOR : 6400\n");
printf("DPI SUPPORT : PC WITH USB PORT 1,990 THB\n\n");
break;
default:printf("Please select 1-7\n");
}
printf("\n");
do{
printf("Do you want to continue?(N/E)");
ans=getche();
printf("\n");
}while(toupper(ans) !='N'&&toupper(ans)!='E');
}while(toupper(ans)=='N');
getch();
}
รบกวนช่วยแก้โปรแกรมทีครับ Turbo c++
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void main(void)
{
char ans;
do{
clrscr();
gotoxy(1,1);
textcolor(14);
textbackground(8);
cprintf("Computer Hardware Stores\n");
gotoxy(1,3);
textcolor(12);
textbackground(8);
cprintf("Please Select 1-7\n");
gotoxy(1,4);
textcolor(9);
textbackground(8);
cprintf("1.Computer\n");
gotoxy(1,5);
textcolor(9);
textbackground(8);
cprintf("2.CPU\n");
gotoxy(1,6);
textcolor(9);
textbackground(8);
cprintf("3.Mainboard\n");
gotoxy(1,7);
textcolor(9);
textbackground(8);
cprintf("4.Monitor\n");
gotoxy(1,8);
textcolor(9);
textbackground(8);
cprintf("5.Printer\n");
gotoxy(1,9);
textcolor(9);
textbackground(8);
cprintf("6.Flash Drive\n");
gotoxy(1,10);
textcolor(9);
textbackground(8);
cprintf("7.Gaming Gear\n");
gotoxy(1,11);
textcolor(9);
textbackground(8);
cprintf(" Select : ");
ans=getche();
printf("\n");
switch(ans){
case'1': clrscr();
printf("Computer\n\n");
printf("1. DESKTOP PC ACER ASPIRE TC-710-644G1T00MGI/T003\n");
printf("CPU-INTEL CORE I5-6400 RAM : 4 GB\n");
printf("HDD : 1 TB VGA : GT 730 OS : DOS 18,900 THB\n\n");
printf("2. DESKTOP PC ACER ASPIRE TC-710-644G1T00MI/T008\n");
printf("CPU : INTEL CORE I5-6400 RAM : 4 GB\n");
printf("HDD : 1 TB VGA : INTEL HD GRAPHICS OS : DOS 15,990 THB\n\n");
printf("3. DESKTOP PC ACER ASPIRE TC704-314G5000MI\n");
printf("CPU : INTEL CELERON N3150 RAM : 4 GB\n");
printf("HDD : 500 GB VGA : INTEL HD GRAPHICS OS : DOS 8,990 THB\n\n");
printf("4. DESKTOP PC ACER ASPIRE TC704-374G1T00MI\n");
printf("CPU : INTEL PENTIUM J3710D RAM : 4 GB\n");
printf("HDD : 1 TB VGA : UMA OS : DOS 10,990 THB\n\n");
printf("5. DESKTOP PC ACER PREDATOR G3-710-648G1T00MGI\n");
printf("CPU : INTEL CORE I5-6400 RAM : 8 GB\n");
printf("HDD : 1 TB VGA : GTX 950 2GB OS : WINDOWS 10 38,900 THB\n");
break;
case'2' :clrscr();
printf("CPU\n\n");
printf("CPU AMD AM3+ FX-4300 3.8 GHz\n");
printf("CORES : 4 THREADS : 4 3,590 THB\n\n");
printf("CPU AMD AM3+ FX-4350 3.6 GHz\n");
printf("CORES : 4 THREADS : 4 3,930 THB\n\n");
printf("CPU AMD AM3+ FX-8370 4.0 GHz\n");
printf("CORES : 8 THREADS : 8 7,590 THB\n\n");
printf("CPU AMD AM3+ FX-9370 4.4 GHz\n");
printf("CORES : 8 THREADS : 8 7,790 THB\n\n");
break;
case'3' :clrscr();
printf("Mainboard\n\n");
printf("MAINBOARD AM3+ ASROCK 960GM-VGS3 FX\n");
printf("SOCKET : AM3+ CHIPSET : AMD 760G / AMD SB710\n");
printf("MEMORY : 2 x DDR3 DIMM 1,390 THB\n\n");
printf("MAINBOARD AM3+ ASROCK 970 EXTREME3 (REV2)\n");
printf("SOCKET : AM3+ CHIPSET : AMD 970 / AMD SB950\n");
printf("MEMORY : 4 x DDR3 DIMM 2,750 THB\n\n");
printf("MAINBOARD AM3+ MSI 990FXA GAMING\n");
printf("SOCKET : AM3+ CHIPSET : AMD 990FX & SB950\n");
printf("MEMORY : 4 x DDR3 DIMM 4,890 THB\n\n");
printf("MAINBOARD AM3+ GIGABYTE 990FX GAMING\n");
printf("SOCKET : AM3+ CHIPSET : AMD 990F/ SB950\n");
printf("MEMORY : 4 x DDR3 DIMM 5,190 THB\n\n");
break;
case'4' :clrscr();
printf("Monitor\n\n");
printf("18.5"" LED SAMSUNG LS19F350HNEXXT\n");
printf("SIZE : 18.5"" CONTRAST : MEGA RESPONSE\n");
printf("TIME : 14 ms 2,790 THB\n\n");
printf("24"" LED SAMSUNG LS24F350FHEXXT\n");
printf("SIZE : 24"" CONTRAST : 1000 : 1 RESPONSE\n");
printf("TIME : 4 (GTG) 4,690 THB\n\n");
printf("MONITOR 27 SAMSUNG LC27F390FHEXXT\n");
printf("SIZE : 27"" CONTRAST : 3000:1 RESPONSE\n");
printf("TIME : 4 ms 12,900 THB\n\n");
printf("34"" UHD SAMSUNG 34E790CNS/XT (CURVED)\n");
printf("SIZE : 34"" CONTRAST : 3000:1 RESPONSE\n");
printf("TIME : 4 (GTG) ms 31,900 THB\n\n");
break;
case'5' :clrscr();
printf("Printer\n\n");
printf("PRINTER RICOH SP 211 LASER\n");
printf("MONO LASER : PRINT 1,990 THB\n\n");
printf("PRINTER RICOH SP C240DN LASER COLOR\n");
printf("COLOR LASER : PRINT 4,690 THB\n\n");
printf("PRINTER RICOH SP C250DN LASER COLOR\n");
printf("COLOR LASER : PRINT/WIFI 5,990 THB\n\n");
printf("PRINTER RICOH SP C250SF LASER COLOR ALL IN ONE\n");
printf("COLOR INKJET : PRINT/SCAN/COPY/FAX/WIFI 15,990 THB\n\n");
break;
case'6' :clrscr();
printf("Flash Drive\n\n");
printf("8 GB FLASH DRIVE KINGSTON SE9 (DTSE9H/8GB)\n");
printf("CAPACITY : 8 GB \n");
printf("READ SPEED : 10 MB/s WRITE SPEED : 5 MB/s 130 THB\n\n");
printf("16 GB FLASH DRIVE KINGSTON (DTDUO3C/16GB)\n");
printf("CAPACITY : 16 GB \n");
printf("SPEED : 100 MB/s WRITE READ SPEED : 15 MB/s 330 THB\n\n");
printf("32 GB FLASH DRIVE KINGSTON (DTDUO3C/32GB)\n");
printf("CAPACITY : 32 GB READ SPEED : 100 MB/s\n");
printf("WRITE SPEED : 15 MB/s 450 THB\n\n");
printf("64 GB FLASH DRIVE KINGSTON (DTIG4/64GBFR) USB 3.1\n");
printf("CAPACITY : 64 GB READ SPEED : N/A WRITE SPEED : N/A 560 THB\n\n");
break;
case'7' :clrscr();
printf("Gaming Gear\n\n\n");
printf("Keyborad\n\n");
printf("KEYBOARD ASUS CERBERUS\n");
printf("FEATURES : RUBBER DOME 1,290 THB\n\n");
printf("KEYBOARD ASUS CERBERUS WHITE\n");
printf("FEATURES : MEMBRANE WITH RUBBER DOME 1,690 THB\n\n");
printf("Mouse\n\n\n");
printf("MOUSE ASUS CERBERUS\n");
printf("OPTICAL SENSOR : 2500");
printf("DPI SUPPORT : PC WITH USB PORT 690 THB\n\n");
printf("MOUSE ASUS ROG GLADIUS\n");
printf("OPTICAL SENSOR : 6400\n");
printf("DPI SUPPORT : PC WITH USB PORT 1,990 THB\n\n");
break;
default:printf("Please select 1-7\n");
}
printf("\n");
do{
printf("Do you want to continue?(N/E)");
ans=getche();
printf("\n");
}while(toupper(ans) !='N'&&toupper(ans)!='E');
}while(toupper(ans)=='N');
getch();
}