Robert1995 22 Light Poster

damn . i am sorry won't happen again

Robert1995 22 Light Poster

if you're planning to do it with switch it will be a pain

#include <iostream>

using namespace std;

int main ()
{
    int i;
    cout<<"Sigh ";cin>>i;cout<<endl<<"Answer : ";
    if(i>=70 && i<=100)cout<<"A";
    if(i>=60 && i<=69)cout<<"B";
    if(i>=50 && i<=59)cout<<"C";
    if(i>=40 && i<=49)cout<<"D";
    if(i>=0 && i<=39)cout<<"F";
    if(i<0 || i>100)cout<<"Not Good";

}
Fbody commented: Don't hand out code willy-nilly, it's counter productive and against forum rules. +0
Robert1995 22 Light Poster

This should work . But if you enter the word "Alfa" it says that your grade is "4.00" . Good Luck Debugging it , i ain't doing your whole homework

#include <iostream.h>

char grade;
int i=1;

int main(){
 do{
 cout<< "Enter Grade : ";cin>>grade;
 if (grade == 'A'){cout<< "4.00";i=0;}
 if (grade == 'A-'){cout<< "3.70";i=0;}
 if (grade == 'B+'){cout<< "3.50";i=0;}
 if (grade == 'B'){cout<< "3.00";i=0;}
 if (grade == 'B-'){cout<< "2.67";i=0;}
 if (grade == 'C+'){cout<< "2.50";i=0;}
 if (grade == 'C'){cout<< "2.00";i=0;}
 if (grade == 'C-'){cout<< "1.67";i=0;}
 if (grade == 'D+'){cout<< "1.33";i=0;}
 if (grade == 'D'){cout<< "1.00";i=0;}
 if (grade == 'E'){cout<< "0.00";i=0;}
 if(i==1)cout<<"Wrong Grade"<<endl;
 }while(i==1);
}
WaltP commented: We do NOT give working answers on this forum. Whe HELP them find their own answers. -2
Robert1995 22 Light Poster

Use a library called <string.h> very nice for searching...
- Search a char in stringhttp://www.cplusplus.com/reference/clibrary/cstring/strpbrk/
- String Length http://www.cplusplus.com/reference/clibrary/cstring/strlen/
P.S This program can be done just by doing some google.com search

Robert1995 22 Light Poster

Wait .. So you're asking if this program is working correctly ?
Tip Check Your Total Interest

Robert1995 22 Light Poster

Tips : Download Visual C++ From Microsoft it's extremely easy . I managed to make this kind of calculator in 5 minutes with 6 operations .
Tips :
-Use <math.h> for sqrt & pow ;
-use radio buttons ;
-use 2 boxes for input numbers ;
Hope this helped

Robert1995 22 Light Poster

Well that's all the info i got . If you could help thanks

Robert1995 22 Light Poster

Hello , i am looking just for algorithmic or ideas .Please help me I spent more than 3 days on this problem.

1) An overview of what your program does.
My program works only for strictly pair k.
2) The result of your current code.
My current code works for like 1/3 tests that i found out there.
3) What you expected your code to do.
How many strings can consist of N binary digits of the K figures to have value 1?
Since this problem is too simple, he adds the following condition: the figures with the value 1 may be placed only on the positions that are pair, while the numbers with the value 0 can be placed anywhere in the string.
4) The contents of any input files (if appropriate)
For Example
n=7 k=2 ;
0 1 0 1 0 0 0
0 1 0 0 0 1 0
0 0 0 1 0 1 0
sol = 2;

Thanks for helping .