Question
c++ language

Step 1. Try to execute the following program (CP11E02) and record the results. #include <iostream.h> #include <string.h> clas
Step 2. Modify the statement tv_show one(One Day to Live,60,d); to read tv_show one; What happens when you try to compile
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer: Hey!! kindly find your solution below. Let me know if any issue. Thanks.

During compile its showing error s was not declared because if we use variable in program we have to declare them before use.
title[ ] is an array we have to pass an array if you replace 's' with't' it wont show error.
tv_show is a class and in class we have a parameterized constructor when we call class we have to pass parameters. Constructor of a class itself called when we use class name in main. That's why it is showing that name one there is no matching
function with one.
10 public: 11 tv_show(char t[], int 1, char k) 12 - { 13 strcpy(title,s); 14 length = 1; 15 kind = k; 16 } 17 }; 18 int main(10 public: 11 tv_show(char t[], int 1, char k) 12 - { 13 strcpy(title,s); 14 length = 1; 15 kind = k; 16 } 17 }; 18 int main(

Add a comment
Know the answer?
Add Answer to:
c++ language Step 1. Try to execute the following program (CP11E02) and record the results. #include...
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
  • what is the output of the following program? #include<stdio.h> #include<string.h> int main(void){ char word[20]; int i...

    what is the output of the following program? #include<stdio.h> #include<string.h> int main(void){ char word[20]; int i =0    strcpy(word, "ORGANISE"); while(word[i] !='\0'){ if(i%2 ==1) word[i] = 'C'; i++; } printf("%s",word); return 0; }

  • Given the following program: #include <stdio.h> struct student { int id; char name[20]; char grade; };...

    Given the following program: #include <stdio.h> struct student { int id; char name[20]; char grade; }; void func(struct student stud); int main() { struct student astud; astud.id=9401; strcpy(astud.name, "Joe"); astud.grade = 'A'; func(astud); return 0; } Abdelghani Bellaachia, CSCI 1121 Page: 16 void func(struct student astud) { printf(" Id is: %d \n", astud.id); printf(" Name is: %s \n", astud.name); printf(" Grade is: %c \n", astud.grade); } Modify this program to include the address of a student as a separate structure....

  • Write output of following program in C# afterremoving error if any. Note: Be sum of first...

    Write output of following program in C# afterremoving error if any. Note: Be sum of first two digit of your Roll no. Run the code after entering the value of B. Do not show error because of B. #include <iostream> using namespace std; class stud { public: char name[30.clas[10]; int rolage: void enter() { cout<<"Enter Student Name: "; cin>>name; cout<<"Enter Student Age: "; cin>>age; cout<<"Enter Student Roll number: "; cin>>rol; cout<<"Enter Student Class Year: "; cin>>clas; } void display {...

  •    moviestruct.cpp #include <iostream> #include <fstream> #include <cstdlib> #include <ostream> #include <fstream> #include <cstdlib> #include <cstring>...

       moviestruct.cpp #include <iostream> #include <fstream> #include <cstdlib> #include <ostream> #include <fstream> #include <cstdlib> #include <cstring> using namespace std; typedef struct{ int id; char title[250]; int year; char rating[6]; int totalCopies; int rentedCopies; }movie; int loadData(ifstream &infile, movie movies[]); void printAll(movie movies[], int count); void printRated(movie movies[], int count); void printTitled(movie movies[], int count); void addMovie(movie movies[],int &count); void returnMovie(movie movies[],int count); void rentMovie(movie movies[],int count); void saveToFile(movie movies[], int count, char *filename); void printMovie(movie &m); int find(movie movies[], int...

  • C++ Recursion Practice! 1)Multiplication #include <iostream.h> int Multiply(int M, int N) //Performs multiplication using the +...

    C++ Recursion Practice! 1)Multiplication #include <iostream.h> int Multiply(int M, int N) //Performs multiplication using the + operator. //Pre : M and N are defined and N > 0. //Post: Returns M x N { int Prod; if (N == 1)     Prod = M;                       //base case else     Prod = M + Multiply(M, N - 1); //recursive step return Prod; } 2) Reverse #include <iostream.h> void Reverse(int N) //Displays string of length N in the reverse order //Pre : N...

  • Take the following C++ code and add to it the following: Write a program that reads...

    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...

  • Need help with this C program? I cannot get it to compile. I have to use...

    Need help with this C program? I cannot get it to compile. I have to use Microsoft Studio compiler for my course. It's a word game style program and I can't figure out where the issue is. \* Program *\ // Michael Paul Laessig, 07 / 17 / 2019. /*COP2220 Second Large Program (LargeProg2.c).*/ #define _CRT_SECURE_NO_DEPRECATE //Include the following libraries in the preprocessor directives: stdio.h, string.h, ctype.h #include <stdio.h> /*printf, scanf definitions*/ #include <string.h> /*stings definitions*/ #include <ctype.h> /*toupper, tolower...

  • Problem with C++ program. Visual Studio say when I try to debug "Run-Time Check Failure #2...

    Problem with C++ program. Visual Studio say when I try to debug "Run-Time Check Failure #2 - Stack around the variable 'string4b' was corrupted. I need some help because if the arrays for string4a and string4b have different sizes. Also if I put different sizes in string3a and string4b it will say that those arrays for 3a and 3b are corrupted. But for the assigment I need to put arrays of different sizes so that they can do their work...

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