Create a program with function main() and menu with functions for:
A) Inserting several numbers from the keyboard into one-dimensional array (the numbers should be less than 20);
C) Overwriting of the second array into third array in which the elements are put in descending order.
D)Displaying information about the array. (I guess this is A,B and C)
I'm really not good in C++ so I don't need anything complicated. This is what I have done so far:
#include <iostream>
using namespace std;
const int MAX_SIZE = 20;
int inserting (int elements []);
int reverseorder (int elements []);
int descendingorder (int elements[]);
int display (int elements[]);
int main(){
int choice;
cout << "1. Insert several numbers" << endl;
cout << "2. The numbers in reverse order" << endl;
cout << "3.The numbers in descending order"<< endl;
cout << "4. Display array with information"<<endl;
cout << "\n Type your choice here:" ;
cin >> choice;
if (choice < 5 && izbor > 1) continue; // here I get a message that continue statement is not withing a loop
switch (choice)
{
case 1: int inserting (int elements []);
case 2: int reverseorder (int elements []);
case 3: int descendingorder (int elements[]);
case 4: int display (int elements[]);
} // I am not really sure if the whole switch statement is correct...I get a message "Error:expected primary-expression before "int"".
After I do this I have to start writing the functions but I find difficulty to do it....Any help will be appreciated...
Thanks in advance,
This post has been edited by modi123_1: 11 December 2014 - 10:28 AM
Reason for edit:: Please use the 'code' button in the editor.

New Topic/Question
Reply


MultiQuote



|