Answer
Let consider the rollnumber as 135, so sum of 1 and 3 is 4 , ie =4 .
so giving value as 4 in the code we get the output
Here for loop will print Age Name R.no Class times. So if no change is possible to the code , the above output will be correct .
In my opinion , this for loop is not needed in this code , which makes the output wrong , so after removing it we will get the below output
Write output of following program in C# afterremoving error if any. Note: Be sum of first...
61. The following program is accepted by the compiler: int sum( int x, int y ) { int result; result = x + y; } T__ F__ 62. The following implementation is accepted by the compiler: void product() { int a; int b; int c; int result; cout << "Enter three integers: "; cin >> a >> b >> c; result = a * b * c; ...
Based on this program modify the source code so that it will able to save the student record into a database txt and able to display and modify from a database txt as well. you will also need to able to modify the code so it will accept name such as "john kenny " and the progrom should also ask for the student id number. #include<iostream> #include<stdlib.h> using namespace std; struct st { int roll; char name[50]; char grade; struct...
Code in C++: Please help me fix the error in function: void write_account(); //function to write record in binary file (NOTE: I able to store data to a txt file but however the data get error when I try to add on data the second time) void display_all(); //function to display all account details (NOTE: This function is to display all the info that save account.txt which is ID, Name, and Type) void modify_account(int); //function to modify record of file...
This is for a C++ program: I'm almost done with this program, I just need to implement a bool function that will ask the user if they want to repeat the read_course function. I can't seem to get it right, the instructions suggest a do.. while loop in the main function. here is my code #include <iostream> #include <cstring> #include <cctype> using namespace std; const int SIZE = 100; void read_name(char first[], char last[]); void read_course(int & crn, char des[],...
what is the output for the following code? explain the steps. /*#include <iostream> using namespace std; int f(int &i) { i = 10; return(5 * i); } int main() { int n = 5; f(n); cout << n << "\n"; return 0; } #include <iostream> using namespace std; int sub1(int n) { n--; return n; } int main() { int m = 10; for(int j = 0; j < 10; j++) m -= sub1(j); cout << m << "\n"; return...
please help me fix the error in here #include<iostream> #include <string> using namespace std; string getStudentName(); double getNumberExams(); double getScoresAndCalculateTotal(double E); double calculateAverage(double n, double t); char determineLetterGrade(); void displayAverageGrade(); int main() { string StudentName; double NumberExam, Average, ScoresAndCalculateTotal; char LetterGrade; StudentName = getStudentName(); NumberExam = getNumberExams(); ScoresAndCalculateTotal= getScoresAndCalculateTotal(NumberExam); Average = calculateAverage(NumberExam, ScoresAndCalculateTotal); return 0; } string getStudentName() { string StudentName; cout << "\n\nEnter Student Name:"; getline(cin, StudentName); return StudentName; } double getNumberExams() { double NumberExam; cout << "\n\n Enter...
Edit this C++ code to show the output as well. #include<iostream> #include<cstring> using namespace std; class Product { private: // private variables int id_number; char pDescription[40]; int mId; double productPrice; double productMarkUp; int qty; public: // constructor Product() { id_number = 0; strcpy_s(pDescription, ""); mId = 0; productPrice = 0.0; productMarkUp = 0.0; qty = 0; } ...
I'm kind of new to programming, and I am having trouble figuring out why my program isn't running. Below is the code that I wrote for practice. I will comment where it says the error is. So the error that I'm getting is "error: no match for 'operator>>' (operand types are 'std::istream {aka std::basic_istream<char>}' ". I'm not sure why I'm getting this because I added the library <iostream> at the top. Thank you. Code: #include <iostream> using namespace std; class...
Using C++ write the following program: 1) For the song program below, on a separate line write a function to quickly print the list of Streaming Services in your Song class, do not modify the program. 2). The Duration in your Song class contains minutes and seconds. Create a data structure called Duration to group the data, do not modify the program but with it on a separate line. #include<iostream> using namespace std; struct Song { string song_title; ...
Take the following C++ code and add to it the following: Write a program that reads a string and outputs the number of times each lowercase vowel appears in it. Your program must contain a function with one of its parameters as a char variable, and if the character is a vowel, it increments that vowel's count. #include<iostream> #include<string> using namespace std; int countVowel(char, char); int main(void) { string str1; int countA = 0; int countE = 0; int countI...