Professional Documents
Culture Documents
GRP Assignmnet Modifed #1
GRP Assignmnet Modifed #1
GRP Assignmnet Modifed #1
ZVISHAVANE CAMPUS
GROUP MEMBERS
DENNIS MISASE R2116778G Metallurgical Engineering
MOREBLESSING MUSHAYABASA R2114048P Metallurgical Engineering
RUTENDO MATARA R2210834R Metallurgical Engineering
QUESTION 1
Write a C++ program to enter a string then display the message boxes "Greater than 6
characters", "Less than 6 characters", and "Equal to 6 characters" if this number was greater,
less, and equal to six characters respectively.
#include<iostream>
#include<conio.h>
#include<stdio.h>
#include<windows.h>
int main()
char str[50];
int i,Char;
Char=0;
gets(str);
if(str[i]!=' ')
Char++;
if(Char<6)
{
else if(Char>6)
else if(Char=6)
else
getch();
return 0;
QUESTION 2
Write a C++ program to enter a number represents a person age then display the following on
a message boxes:
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
int age;
cout<< "Enter your age:";
cin>> age;
if (age <=0)
{
MessageBox(NULL, "Wrong Age", "Age Message", MB_OK);
}
else if (age < 8)
{
MessageBox(NULL, "Child", "Age Message", MB_OK);
}
else if (age>=8 && age < 18)
{
MessageBox(NULL, "Boy", "Age Message", MB_OK);
}
else if (age >=18 && age < 35)
{
MessageBox(NULL, "Young", "Age Message", MB_OK);
}
else if (age >=35 && age < 65)
{
MessageBox(NULL, "Old", "Age Message", MB_OK);
}
else
{
MessageBox(NULL, "Very OLd", "Age Message", MB_OK);
}
return 0;
}
QUESTION 3
Write C++ program to make countdown loop using goto statement.
#include <iostream>
#include <windows.h>
int main()
loop:
count--;
if(count >-0)
{
Sleep(200);
goto loop;
return 0;