How to use PlaySound in C?

HELP with my c++. how to use string, if-else, or SWITCH.?

  • this is my project in school. i am trying to make a program that would compute for molarity and molality, using either grams or moles. when the user would give out grams, i was suppose to ask for which element so that the program i would make would compute for the corresponding moles. what to do ? :( #include<stdio.h> #include<conio.h> #include<iostream> #include<math.h> #include <string> using namespace std; main () { int x,y,a,b,c,d,g; float m,l,Q; string Z,Li,Be,B,C,N,O,F,Ne,Na,Mg,Al,Si,P,S,Cl,… a=1; b=2; c=1; d=2; printf("This Program will compute for Molarity and Molality.\n\n"); printf(" Choose what you want this program to compute. \n\n type (1) Molarity and type (2) Molality. \n\n Enter your choice: "); scanf("%d", &x); { if (x==a) { printf("\n\n You chose Molarity. \n\n"); printf(" Choose if you want to enter in (1) Grams (2) Moles: "); scanf("%d",&y); if (y==c) { printf("\n\nGRAMS\n"); printf("Enter Grams: "); scanf("%d",&g); system("cls"); printf(" ---- ---- \t ---- ---- ---- ---- ---- ---- \n"); printf(" | | | | \t | | | | | | | | | | | | \n"); printf(" |Li| |Be| \t |B | |C | |N | |O | |F | |Ne| You Entered %d grams\n",g); printf(" | | | | \t | | | | | | | | | | | | \n"); printf(" ---- ---- \t ---- ---- ---- ---- ---- ---- \n"); printf(" | | | | \t | | | | | | | | | | | | \n"); printf(" |Na| |Mg| \t |Al| |Si| |P | |S | |Cl| |Ar| Choose which element\n"); printf(" | | | | \t | | | | | | | | | | | | you want to convert\n"); printf(" ---- ---- \t ---- ---- ---- ---- ---- ---- from grams to moles.\n"); printf(" | | | | \t | | | | | | | | | | | | Example: Al [enter]\n"); printf(" |K | |Ca| \t |Ga| |Ge| |As| |Se| |Br| |Kr|\n"); printf(" | | | | \t | | | | | | | | | | | |\n"); printf(" ---- ---- \t ---- ---- ---- ---- ---- ----\n"); printf(" | | | | \t | | | | | | | | | | | |\n"); printf(" |Rb| |Sr| \t |ln| |Sn| |Sb| |Te| |I | |Xe|\n"); printf(" | | | | \t | | | | | | | | | | | |\n"); printf(" ---- ---- \t ---- ---- ---- ---- ---- ---- \n"); printf(" | | | | \t | | | | | | | | | | | |\n"); printf(" |Cs| |Ba| \t |Tl| |Pb| |Bi| |Po| |At| |Rn|\n"); printf(" | | | | \t | | | | | | | | | | | |\n"); printf(" ---- ---- \t ---- ---- ---- ---- ---- ---- \n"); printf("Enter your Element here: "); scanf("%s",&Z); if (Z=="Li") { } if you guys could give me some codes on how this would work :( i need help asap :(

  • Answer:

    cplusplus.com best site i would like to call book in c++ programming visit

jai at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.