If you have any doubts, please give me comment....
#include<iostream>
using namespace std;
double fudge(double s){return s*2.3;};
int main(){
cout<<"Your original estimate ";
double estimate;
cin>>estimate;
cout<<endl;
for(int i=0; i<3; i++) // here removed semicolon
cout<<"Estimate "<<fudge(estimate)<<endl;
return 0;
}
13) Output:
2.3
2.3
2.3
14)
true
false
4
12) 8 pts. Find the errors in the following code fragment and correct them. #i nclude...
C++ Fix the errors in the following code. (Not all errors are syntax related) #include <iostream> using namespace std; int main() { //Part A int numA numA = 10; cout << numA << end; /* Part B */*/ int numB = numA; cin >> usrInput; int usrInput = 0; numB = numB + usrInput; cout << numB <"/n"; /* Part C */ int numC = 10000000000; cout << numC << endl; return 0; }
Debugging: The code below has six errors. The errors may be syntax errors or logic errors, and there may be more than one per line; examine the code carefully to find them. Indicate each of the errors you find by writing the line number and correction in the space provided below. This program is designed to take a constant number of scores (3 in this case) and store them into an array. Then the array is passed to a function...
Today assignment , find the errors in this code and fixed them. Please I need help with find the errors and how ro fixed them. #include <iostream> #include <cstring> #include <iomanip> using namespace std; const int MAX_CHAR = 100; const int MIN_A = 90; const int MIN_B = 80; const int MIN_C = 70; double getAvg(); char determineGrade(double); void printMsg(char grade); int main() { double score; char grade; char msg[MAX_CHAR]; strcpy(msg, "Excellent!"); strcpy(msg, "Good job!"); strcpy(msg, "You've passed!"); strcpy(msg, "Need...
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;...
Find errors in code and get 100% feedback!! Foblem (30 Points) This program This programaverages > // It uses the ram has errors. Find the errors in the code: n averages 3 test scores. the variable perfect Score as a flag. Line # Line # include <iostream> using namespace std; int maino cout << "Enter your 3 test scores and I will ": <<"average them;": int score1, score2, score3, cin >> score1 >> score2 >> score3; double average; average (scorel...
2 The following code has some errors. Please point out and correct them (there might be more than 1 errors). Note: the use of const data member increment and member function print. // This code has some errors. #include using namespace std; class Increment { public: Increment( int c = 0, int i = 0); void addIncrement() const { count -= increment }; void print() const; private: int count; const int increment; }; Increment::Increment(int c, int i) { cout =...
81. The following function call doesn’t agree with its prototype: cout << BoxVolume( 10, 5 ); int BoxVolume(int length = {1}, int width = {1}, int height = {1}); T__ F__ 82. The following function is implemented to swap in memory the argument-values passed to it: void swap(int a, int b) { int temp; temp = a; a = b; b = temp; ...
31. The following code segment is syntactically correct: int number{20}; cout << number << setbase(16) << " " << number << setbase(10) << " " << number << showpos << " " << number << endl; T__ F__ 32. The following statement wants to determine if ‘count’ is outside the range of 0 through 100: if (count < 0 && count > 100) T__ F__ 33. There is...
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 <<...
C++ question The code below has five errors. The errors may be syntax errors or logic errors, and there may be more than one per line; examine the code carefully to find them. Indicate each of the errors you find by writing the line number and correction in the space provided below. You must find and correct all five of the errors. If there were no errors, this code would output: Paycheck for 123-45-678 : $690.625 Paycheck for 876-54-321 : $818.125 1...