Question
okay so here is my c++ code and the errors im really stuck on fixing what i did wrong it seems to be the same repeated error
our job is to write a menu driven program that can convert to display Morse Code ere is the menu the program should display M
Instructions main.cpp Tests Run/Console 5 6 #include <iostream> 7 #include<iomanip> 8 #include<cmath> 9 #include<string> 10 u
Tests Run / Console Instructions main.cpp 32 if(toPrint I) 33 cout << 34 if(toPrint == j) 35 cout << .--- 36 if(toPrint =
Instructions main.cpp Tests Run / Console 8 65 11 59 cout << 60 if(toPrint == W 61 cout << .--; 62 if(toPrint == X) 63
Instructions main.cpp Tests Run/Console 95 11 86 cout << ---.. 87 if(toPrint 9) 88 cout << ----.; 89 //punctuation in m
Instructions main.cpp Tests Run/Console 113 } 114 } 115 //void function that takes initials as a string and print in morse co
od Instructions main.cpp Tests Run / Console 140 - int done = 0; while( done 0) { 141 cout << endl <<endl; 142 cout << Menu
Instructions main.cpp Tests Run / Console } T! 167 //if user chooses N 168 else if (userChoice N){ 169 cout Here are the n
codo Text Size! Regular Console: Thibbed 7 Instructions US main.cpp o Tests Run / Console эсээ else if (userChoice == S) { c
COMPILER OUTPUT STDERR: main.cpp:11:1: error: toPrint does not name a type; did you mean _lrint? toPrint - toupper(toPrin
main.cpp:30:1: error: expected unqualified-id before if if (toPrint == H) main.cpp:32:1: error: expected unqualified-id b
A main.cpp:50:1: error: expected unqualified-id before if if (toPrint == R) main.cpp:52:1: error: expected unqualified-id
main.cpp:71:1: error: expected unqualified-id before if if (toPrint == 1) main.cpp:73:1: error: expected unqualified-id b
main.cpp:92:1: error: expected unqualified-id before if if (toPrint == ,) main.cpp:94:1: error: expected unqualified-id b
main.cpp:110:9: note: suggested alternative: unsigned for(unassigned int i=0;i<userString.length()-1;++){ unsigned main.cpp:
main.cpp:112:9: note: suggested alternative: print printCode (userChar); printf main.cpp: In function void printInitials(s
0 0
Add a comment Improve this question Transcribed image text
Answer #1

In the line number 11, what is the data type of toPrint. You have missed the data type. That's why these kind of error is coming. correct that. You program will be free of error after correction.

DON'T FORGET TO HIT LIKE.T

THANKS BY HEART.

Add a comment
Know the answer?
Add Answer to:
okay so here is my c++ code and the errors im really stuck on fixing what...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • so i have my c++ code and ive been working on this for hours but i...

    so i have my c++ code and ive been working on this for hours but i cant get it to run im not allowed to use arrays. im not sure how to fix it thank you for the help our job is to write a menu driven program that can convert to display Morse Code ere is the menu the program should display Menu Alphabet Initials N-Numbers - Punctuations S = User Sentence Q- Quit Enter command the user chooses...

  • What are the errors in the following code? My professor gave us this prewritten code and...

    What are the errors in the following code? My professor gave us this prewritten code and asked us to find the errors in it so that it can run properly #include <cstdlib> #include <ctime> #include <iostream> using namespace std; // input: integer // output: none // adds five to the given parameter void addFive( int x ) { x += 5; } // input: none // output: a random number int generateRandomNumber() { srand( time(0) ); return rand() % 100;...

  • Please help fix my code C++, I get 2 errors when running. The code should be...

    Please help fix my code C++, I get 2 errors when running. The code should be able to open this file: labdata.txt Pallet PAG PAG45982IB 737 4978 OAK Container AYF AYF23409AA 737 2209 LAS Container AAA AAA89023DL 737 5932 DFW Here is my code: #include <iostream> #include <string> #include <fstream> #include <vector> #include <cstdlib> #include <iomanip> using namespace std; const int MAXLOAD737 = 46000; const int MAXLOAD767 = 116000; class Cargo { protected: string uldtype; string abbreviation; string uldid; int...

  • The following C++ code include 3 files: Patient.h, Patient.cpp and Main.cpp. The program basically creates and stores patient records. The original code has everything in a single .cpp file. I tried t...

    The following C++ code include 3 files: Patient.h, Patient.cpp and Main.cpp. The program basically creates and stores patient records. The original code has everything in a single .cpp file. I tried to divide the code in 3 parts (Patient.h, Patient.cpp and Main.cpp), but it is giving me errors. Patient.h #ifndef PATIENT_H #define PATIENT_H #include <string> #include "Patient.cpp" using namespace std; class Patient{ private : string firstname; string lastname; string location; static int cnt; int id; public : Patient(string, string, string);...

  • C++: Need help debugging my code I am writing this and using some other examples as reference code while rewriting it with my own understanding of the material but am having trouble making it finally...

    C++: Need help debugging my code I am writing this and using some other examples as reference code while rewriting it with my own understanding of the material but am having trouble making it finally compile. Below is a picture of the error messages. //main.cpp //Semester Project //Created by J---on 5/6/2019 #include <iostream> #include <fstream> #include <string> #include <sstream> #include <bits/stdc++.h> using namespace std; void instructions(); //displays program details and instructions void openFile(); void takeInput(int*); void switchBoard(int*); struct price {...

  • Find and fix the errors in this C++ code: * This program illustrates a variety of...

    Find and fix the errors in this C++ code: * This program illustrates a variety of common loop errors. * Fix the errors in each section. */ #include <iostream> using namespace std; int main() { cout << "Welcome to Loop World" << endl; // SECTION I: update comment below on how you fixed this section's code, and tests run // FIX = // TESTS: cout << endl; cout << "******************" << endl; cout << "Section I" << endl; cout <<...

  • create a programn in C++ that creates a class that represents a manufactured part on a...

    create a programn in C++ that creates a class that represents a manufactured part on a bill of material (BOM). with the following attributes: identifier (The parts identifier as an alpha numeric string), drawing (The AutoCAD drawing file that represents the part), quantity (The number of parts that are required). implement the functions for the Part class in the file Part.cpp. The file main.cpp will only be used for testing purposes, no code should be written in main.cpp. -part.cpp file:...

  • Hello, I have written a code that I now need to make changes so that arrays...

    Hello, I have written a code that I now need to make changes so that arrays are transferred to the functions as pointer variable. Below is my code I already have. #include<iostream> #include<string> #include<iomanip> using namespace std; //functions prototypes void getData(string id[], int correct[], int NUM_STUDENT); void calculate(int correct[], int incorrect[], int score[], int NUM_STUDENT); double average(int score[], int NUM_STUDENT); void Display(string id[], int correct[], int incorrect[], int score[], double average, int NUM_STUDENT); int findHigh(string id[], int score[], int NUM_STUDENT);...

  • I need help fixing my code: In C++ *************** 1) I want to sum the digits...

    I need help fixing my code: In C++ *************** 1) I want to sum the digits of an n*n matrix 2) find the average I have completed the rest ****Do not use C++ standard library. You must use pointers and pointer arithmetic to represent the matrix and to navigate through it. MY CODE: (I have indicated at which point I need help) #include <iostream> using namespace std; void swap(int *xp, int *yp) { int temp = *xp; *xp = *yp;...

  • im writing a c++ code and getting stuck on two parts. The first part, when I...

    im writing a c++ code and getting stuck on two parts. The first part, when I go to write the customer order out to the file, it writes everything but the price out right. I'll get a weird number like 5.95828e-039 or nan. When I printout to the console it works fine so not sure what's wrong. Second After I write the order out to the file, I then have to go in and read the file and calculate the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT