how do i write a c++ program using && operator along with if/else to deternime the shipping rate?
82337
if(myWeight <= 3) {\n   value = myWeight * 5.45;\n} else if (myWeight <= 7) {\n   value = myWeight * 8.45;\n} else if (myWeight <= 15) {\n   value = myWeight * 11.45;\n} else {\n   value = myWeight * 14.45;\n}
794946
cplusplus.com for C++ programming stuff
267921
You can turn these into proper C++ statements:\n\nread a, b\n\nlet max = a\n\nif max < b\n  let max = b\nendif\n\nprint max\n\nThis program assumes that a <> b.
60224
ASP uses VBScript as a difault scripting language. According to VBScript the syntax of If.. Elsif is as shown in the bellow example. Follow this.\n\nif payment="Cash" then\n   msgbox "You are going to pay cash!"\n elseif payment="Visa" then\n   msgbox "You are going to pay with visa."\n elseif payment="AmEx" then\n   msgbox "You are going to pay with American Express."\n else\n   msgbox "Unknown method of payment."\nend If\n\n\nRaghava\nProgrammer Trainee
81883
Details of the algorithm for conversion along with\nsource program written in C can be found at.\nhttp://www.codepedia.com/1/Art_Expressions_p1\n\nA good short article on this topic.\nhttp://www.cs.man.ac.uk/~pjj/cs2121/fix.html
613986
=IF(E12=0,0,\nIF(AND(E12>0,E12<4),\n5.9,IF(E12>=4,12.9,\n"negative value")))\n\nAll on one line!\n\nEdit:  The >= (greater than or equal to) is required else the value of exactly 4 would return "negative value"
34052
I do not know a preprogrammed utility to do this, but can point you in the direction that you might need to go.  See the reference below for the math and an on-line converter:
1151029
try this for an example, you will have to modify the code, I won't do your homework for you, but this should help you out\n\n\n#include <iostream>\n#include <fstream>\n\nusing namespace std;\n\nbool Load(ifstream&);\nbool ReadData(ifstream&, char[],int&);\nvoid PrintData(const char[],int);\nvoid clear(ifstream&);\n\n\nvoid sort(char[],int);\nvoid swapValues(char&,char&);\nint indexOfSmallest(const char a[], int startIndex, int numberUsed);\n\n\nint main()\n{\nifstream file;\nint iSize;\nchar cData[100];\n\ntry\n{\nif(!Load(file))\nthrow "File Handle could not be acquired";\n\nfor(int i=0; i< 3; i++)\n{\nif(!ReadData(file,cData,iSize))\nthrow "Data could not be read";\ncout << iSize << endl;\nPrintData(cData,iSize);\nsort(cData,iSize);\nPrintData(cData,iSize);\n}\n\nfile.close();\n}\ncatch(char* szError)\n{\ncout << endl << "Error: " << szError << endl;\nexit(0x01);\n}\n\nreturn 0;\n}\n\nbool Load(ifstream& iFS)\n{\ntry\n{\niFS.open("c:&#92;test.txt",ios::in);\nif(!iFS.is_open())\nthrow false; \nthrow true;\n}\ncatch(bool bCode)\n{\nreturn bCode;\n}\n}\n\nbool ReadData(ifstream& iFS,char cData[], int& iSize)\n{\ntry\n{\niFS >> iSize;\nif(iSize < 0);\nelse\n{\nclear(iFS);\nfor(int i=0;i < iSize;i++)\niFS.get(cData[i]);\nclear(iFS);\n}\nthrow true;\n}\ncatch(bool bCode)\n{\nreturn bCode;\n}\n}\n\nvoid clear(ifstream& iFS)\n{\nchar c = '&#92;0';\nwhile(c!= '&#92;n' && !iFS.eof())\niFS.get(c);\nc='&#92;0';\n}\n\n\nvoid PrintData(const char cData[], int iSize)\n{\nfor(int i=0; i < iSize; i++)\ncout << cData[i];\ncout << endl;\n}\n\n\nvoid sort(char a[], int numberUsed)\n{\n    int indexOfNextSmallest;\n    int index;\n\n    for (index = 0; index < numberUsed - 1; index++)\n    {\nindexOfNextSmallest = indexOfSmallest(a, index, numberUsed);\n        swapValues(a[index], a[indexOfNextSmallest]);\n    }\n}\n\nvoid swapValues(char& v1, char& v2)\n{\n    char temp;\n    temp = v1;\n    v1 = v2;\n    v2 = temp;\n}\n\nint indexOfSmallest(const char a[], int startIndex, int numberUsed)\n{\n    int min = a[startIndex],\n        indexOfMin = startIndex;\n    int index;\n\n    for (index = startIndex + 1; index < numberUsed; index++)\n        if (a[index] < min)\n        {\n            min = a[index];\n            indexOfMin = index;\n        }\n\n    return indexOfMin;\n}
346423
check out http://www.planet-source-code.com - I don't do C++, but I use that site all the time, and it has great examples in source code form.
172063
http://www.thefreecountry.com/compilers/cpp.shtml
813680
i'll give you the basic syntax..fill in the rest yourself\n\n#include<iostream.h>\n#include<conio.h>\n#include<stdio.h>\n\nvoid main()\n{\n  clrscr();\n   cout<<"&#92;t&#92;t Currency converter "<<endl;\n  cout<<"&#92;n 1) US dollars to peso "<<endl;\n  cout<<"&#92;n 2) US dollars to Euros "<<endl;\n  cout<<"&#92;n 3.........  "<<endl;\n  cout<<"&#92;n 4 ..... "<<endl;\n .....................................\n........................................\ncout<<"&#92;n enter your choice ";\ncin>>choice;\n\nswitch(choice)\n  {\n     case 1:\n       clrscr();\n        cout<<"&#92;n enter the amount in US dollars you want to convert to pesos ";\n      cin>>amount;\n      cout<<"&#92;n&#92;n "<<amount<<" dollars are equal to "<<amount*9.32 <<" pesos "<<endl;\n     break;\n     case 2 :\n        clrscr();\n        cout<<"&#92;n enter the amount in US dollars you want to convert to Euros ";\n....................................\n ...........................\n   case 3:\n ...................................\n...\n\ndefault :\n   cout<<"&#92;n invalid choice...";\n   exit(0);\n   }\n\ngetch();\n   \n\n}
1056055
1) You should try making a flow-chart to see the issues here...\n\n2) Your comparison:  if %1==%1 (and also for %2) will ALWAYS BE TRUE and will never get to parts of your code!
614947
#include <iostream.h>\n#include <conio.h>\n#include <process.h>\n\nmain()\n\n{\n\nchar c;\n\nclrscr();\ncout<<"Press 0 to exit&#92;n";\n\ndo\n{\n\n c=getch();\n\n switch(c)\n {\n   case '0': exit(0);\n   case '1': cout<<"I";break;\n   case '2': cout<<"L";break;\n   case '3': cout<<"o";break;\n   case '4': cout<<"v";break;\n   case '5': cout<<"e";break;\n   case '6': cout<<"U";break;\n }\n\n} while (1);\nreturn 0;\n}
438944
#include<stdio.h>\n#include<conio.h>\n#include<ctype.h>\n\nint main()\n{\n  char ch;\n  cout<<"enter some text&#92;n";\n  do{\n    ch=getch();\n    putchar(ch);\n  }while(ch!='&#92;n');\n  return 0;\n}
892159
Pass a value to detect and put in a if condition. Mail me to technoblitzs@yahoo.com with the code and I shall correct it for you.
374089
It has 2-bytes code, so you need to examine two consequent bytes. It is not C++ specific, it is PC-specific.
1078011
Conditional statements only include those using if, if else, if else if, and switch, so while, do while, and for loops should be acceptable.  The answer is then either:\n\nint x = 1;\ndo{\n  printf(“&#92;n”, x);\n  x++;\n}while (x < 100);\ndo{\n  printf(“&#92;n”, x);\n  x--;\n}while (x > 0);\n\nOR:\nfor (int x = 1; x < 100; x++){\n  printf(“&#92;n”, x);\n}\nfor (x = 100; x < 0; x--){\n  printf(“&#92;n”, x);\n}