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...
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...
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; ...
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; ...
I have this program using class that plays the game hangman the only thing that I need to make is a file or a function that will store the 10 words ( hey, ace, cow, fix, fly, fun, ice, max, new, sam) when the user starts the game the words most be chosen randomly not in any order C++ code: // Header of the class #ifndef Hangman_H #define Hangman_H #include <string> #include <iostream> #include <string.h> using namespace std; class Hangman...