Comment down for any queries
Please give a thumb up
Code:
#include <bits/stdc++.h>
using namespace std;
void readEntries(string *words, string *meanings, int
directorySize) {
for(int i = 0; i < directorySize; i++) {
// 2.a Ask for the word
cout << "Enter Term "<<i+1<<": ";
// 2.c Store the word in array
getline(cin,words[i]);
// 2.b Ask for the definition
cout << "Enter the definition for " <<
words[i]<<": ";
// 2.d Store the definition in array
getline(cin,meanings[i]);
}
}
void writeEntries(string *words, string *meanings, int
directorySize) {
// 3. Output entries which were stored
cout << endl << "You entered: " << endl;
for(int i = 0; i < directorySize; i++) {
cout <<i+1<<". "<< words[i] << ": "
<< meanings[i] << endl;
}
}
int main() {
int directorySize;
// 1. Ask the user for directory size
cout << "How Many terms do you want the directory to hold?
";
cin >> directorySize;
string ln;
getline(cin,ln);
// Initialize arrays
string *words = new string[directorySize];
string *meanings = new string[directorySize];
//Read user input
readEntries(words, meanings, directorySize);
//Print user input
writeEntries(words, meanings, directorySize);
// 4. Clear memory
delete words;
delete meanings;
}
Output and compilation:

Comment down for any queries
Please give a thumb up
in c++ sample output Description A dictionary is a collection of words that contain at least...
Modification of original code so it can include 1) at least one array 2)*New English words that are written/saved to the .txt file(s) must be in alphabetical order* (e.g, Apple cannot be in a lower line than Orange). This is what I'm really struggling with as I don't know how to organize alphabetically only the english word translation without the spanish equivalent word also getting organized. The only idea I have right now is to recreate the code using two...
C++ for this exercise, you will make a simple Dungeon Crawl game. For an enhanced version, you can add monsters that randomly move around. Program Requirements While the program is an introduction to two-dimensional arrays, it is also a review of functions and input validation. check: Does the program compile and properly run? does all functions have prototypes? Are all functions commented? Is the program itself commented? Are constants used where appropriate? Are the required functions implemented? Is the dungeon...
Additional code needed:
PartA: BurgerOrder class (1 point) Objective: Create a new class that represents an order at a fast-food burger joint. This class will be used in Part B, when we work with a list of orders. As vou work through this part and Part B, draw a UML diagram of each class in using the UML drawing tool 1) Create a new Lab5TestProject project in Netbeans, right-click on the lab5testproject package and select New>Java Class 2) Call your...