☆國 AA Home Dashboard My courses Evaluate the output for below 4 int main() 5- { int A[5]{2, 1, 3 }; int K = 0; K =A[0] + A[2] + A[4] * 10; 6 7 8 9 10 11 12 13 return 0; 14 } 15 cout << K; O a. 60 O b. None c. 5 Od. 50 e. 6 Clear my choice 1
Q: find and fix all the errors so the code can run #ifndef Student.h #define Student.h class…
A: The code below is an error free modified code from the above given code to store the student details…
Q: below is the code I need help with answering the questions in the image//
A: Here is the explanation about the scope of the variables:
Q: 1 #include 2 #include 3 using namespace std; 4 int main() { const int MAX = 10; char cstr[MAX];…
A: Code :- If you give more memory allocation to the character array cstr[35] it gives no error.…
Q: Jordan University of Science and Technology CS415 Contemporary Programming Techniques Midterm Exam –…
A: I have gone through your question and had implemented class with constructore and all the methods…
Q: Courses Review and Tix the errors in the following code segment. public Task1 { public void…
A: Given code: public Task1{ public void main(Strinng[] args) { x=5; int y=5.0; int…
Q: #include<iostream>#include<string>class Bicycle{friend std::ostream&…
A: The objective of the question is to implement the decrement operator (--) for the Bicycle class in…
Q: A(n) _________ may be used to pass arguments to the constructors of elements in anobject array.
A: Initialization
Q: Code:#include <string>using namespace std;class MOVIE {private:string movieTitle;string…
A: The given code for the class “MOVIE” is used in the below program. Keywords should not be used as…
Q: Huge Integers Design a class that can handle arbitrarily large integers (using strings) that…
A: The following program illustrates how to design a custom class of new data type LargeInt using…
Q: include using namespace std; aclass om { public: void set (int x,int y) cout<<"The sum =" <<x+y<<…
A: Constructor: In C++ the constructors initialize the class object. When the instance of class is…
Q: TOPIC: JOptionPane class Create a Java program that will compute for the total salary of an…
A: Code: class NetSalary{ public static void main(String arg[]) { double gs,it,pt,pf,netSalary;…
Q: #include #include using namespace std; class Students { protected: string firstName; string…
A: C++ is and object oriented programming language.
Q: def is_teenager(age: int) -> bool: "* "Return True iff age represents a teenager between 13 and 18…
A: According to the Question below the solution: Output:
Q: /Please Fix this probem. #include #include Class Soccer { Int g_no, no_assist, no_goal;…
A: /* all c in cout and cin was in capital, so, changed C to small c. */#include <iostream>…
Q: [{Jon true 100} {Fred "The Hammer" Smith false 42} {Martha true 37}] name, has_pet, age Jon,true,…
A: The Go program code is
Q: Fill in the blanks
A: Explanation: The correct code after filling up all the blanks in the code is given below. In the…
Q: Usage: mortgagepmt [-s] -r rate [-d downpayment] price In this assignment, you are asked to do a…
A: Here is the answer below:-
Q: class A Q5: Correct the following code fragment and what will be the final results of the variable a…
A: Source Code #include <iostream> using namespace std; class A { protected: int…
Q: Q5: What would happen if you passed in the address of the initialized global variable into…
A: we can access global variable if there is a local variable through EXTERN and scope resolution . The…
Q: Please fix my code, my error is the bold part This is a program that inputs, processes, and…
A: Introduction: The program ask for the data to fill a studentRec of class StudentRec and then ask…
Q: How this code can be done without #define STOCK 5 #include #include #define STOCKS 5 using…
A: The code can be done without #define STOCK 5 by using const int STOCKS = 5; Code: #include…
Q: 1. Implement a class IntArr using dynamic memory. a. data members: capacity: maximum number of…
A: This code defines a class named IntArr that represents an integer array. It has private members for…
Q: Considere the following variable. ]: Students_Info={'lloyd' : { "name": "Lloyd", "homework":…
A: In python, function is defined using def keyword. The syntax is, def function_name():…
Q: Q1: How many total calls to malloc are made during createEmployee (including readEmployee and…
A: Hi there, please find your solution below, I hope you would find my solution useful and helpful,…
Q: /below is the code I need help with answering the questions in the image// #include…
A: Q3: Many people put the SSN in a char[9] field (1 kind of encouraged it). Is that big enough to hold…
Q: 1#include 2 #include #include 4 #include 3 5 sem_t fork[3]; 6 7 void eat (int phil) { 8…
A: In the given dining Philosopher's problem, Number of philosophers= 3 Number of forks= 3 Number of…
Q: As a starting point, use the files fraction.h, fraction.cpp, testfraction.cpp below: //…
A: Coded using C++.
Q: write coments infront of wery line of code.
A: #include<iostream>#include<string>using namespace std; class Date{public:Date(){month =…
Q: Q5: What would happen if you passed in the address of the initialized global variable into…
A: Here we have given the answer differentiating global and local variables in c. and how they can be…
Q: Q2: If the employee's name is Joe Smith, how much total memory is allocated for the structure and…
A: As per the guidelines we have given answer for the first three question that are Q2, Q3 and Q4. you…
Q: c++ A FastCritter moves twice as fast as a regular critter. When asked to move by n steps, it…
A: Required fastcritter_Tester.cpp file is provided below along with screenshots.
Q: Assign Barbecue's data member caloriesInSlice with a value read from input. Then, assign Ham and…
A: I have done the code using C language. Make sure your environment depends on C language.
Q: //below is the code I need help with answering the questions in the image// #include…
A: #include <stdio.h> #include <stdlib.h> typedef struct{ char name[30]; int id;…
Q: Q5: What would happen if you passed in the address of the initialized global variable into…
A: In the current code there is not initialized global employee variable But if there was a global…
Q: #include #include #include using namespace std; template class A { public: A(){ couta1; A a2; A…
A: Given, The code is given in the C++ programming language. Code: #include <iostream>…
Q: char xusername[10]; char xbankname[10]; int xaccountnum[4]; int xcardnum[14]; int…
A: Flow chart is a step by step process of the program which is represented using different symbols and…
Q: C:/Users/r1821655/CLionProjects/untitled/sequence.cpp:48:5: error: return type specification for…
A: Constructor is a special method that is invoked automatically at the time of object creation. It is…
Q: JAVA ONLY Please create a code that checks if 'user' favourite game is in the top 3 games. if the…
A: By defining array and using for loop we can solve this problem.
Q: Question 3 he C program on the following page was written to provic unction calculate_primes which…
A: Errors can be thrown by the program because of syntax errors and wrong use of functions.
Q: /* Interface File: Movie.h Declaration of Movie Class (Variables - "Data Members" or…
A: The code listing for the three files are given below: /* Interface File: Game.h…
Step by step
Solved in 2 steps
- cout << setw(20) << this->words[i].getWord() << "\t" << this->words[i].getFrequency() << endl; This code keeps giving me errors "class word have no member getfrequency"#include <iostream>using namespace std; class Date{ string year, month, day, hour, minute; public: Date(int=1990, int=1, int=1, int=12, int=1); Date(const Date &date); //getters: int getYear(); int getMonth(); int getDay(); int getHour(); int getMinute(); //setters: void setYear(int); void setMonth(int); void setDay(int); void setHour(int); void setMinute(int); //toString. string to_string();};class Player{private: string name; int age, goal;public: Player(string nname = "player", int nage = 25, int ngoal = 0); //getter string getname(); int getage(); int getgoal(); //setter void setname(string nname); void setage(int nage); void setgoal(int ngoale); //toString string to_string(); return 0; }; This is an C++ CODE i want your help to let the code run so if you can make itbriefly explain this code #include<iostream>#include<string.h> using namespace std; class bank_account{int acno;char nm[100], acctype[100];float bal;public:bank_account(int acc_no, char *name, char *acc_type, float balance){acno=acc_no;strcpy(nm, name);strcpy(acctype, acc_type);bal=balance;}void deposit();void withdraw();void display();};void bank_account::deposit(){int damt1;cout<<"\n Enter Deposit Amount = ";cin>>damt1;bal+=damt1;}void bank_account::withdraw(){int wamt1;cout<<"\n Enter Withdraw Amount = ";cin>>wamt1;if(wamt1>bal)cout<<"\n Cannot Withdraw Amount";bal-=wamt1;}void bank_account::display(){cout<<"\n Name : "<<nm;cout<<"\n Account Type : "<<acctype;cout<<"\n Balance : "<<bal;}int main(){int acc_no;char name[100], acc_type[100];float balance;cout<<"\n Name : ";cin>>name;cout<<"\n Account Type : ";cin>>acc_type;cout<<"\n Balance : ";cin>>balance;bank_account…
- c++ A FastCritter moves twice as fast as a regular critter. When asked to move by n steps, it actually moves by 2 * n steps. Implement a FastCritter class derived from Critter whose move function behaves as described. Complete the following file: fastcritter_Tester.cpp #include <iostream>using namespace std; #include "critter.h" /**A FastCritter moves twice as fast as a regular critter.*/class FastCritter:public Critter{public:void move(int steps);}; . . . int main(){FastCritter speedy;speedy.move(10);cout << speedy.get_history() << endl;cout << "Expected: [move to 20]" << endl;speedy.move(-1);cout << speedy.get_history() << endl;cout << "Expected: [move to 20, move to 18]" << endl;return 0;} Use the following file: critter.h #ifndef CRITTER_H #define CRITTER_H #include <string> #include <vector> using namespace std; /** A simulated critter. */ class Critter { public: /** Constructs a critter at position 0 with blank…1 finclude 2 tinclude 3 +define SIZE 10 4 5 void d_fcn (int *const, int ); 6 int main (void) 7日{ 8 int data[SIZE]; int i; 9 10 for (i=0;i//below is the code I need help with answering the questions in the image// #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; // function to read the employee data from the user void readEmployee(struct employees *emp) { printf("Enter name: "); gets(emp->name); printf("Enter ssn: "); for (int i = 0; i < 9; i++) scanf("%d", &emp->ssn[i]); printf("Enter birth year: "); scanf("%d", &emp->yearBorn); printf("Enter salary: "); scanf("%d", &emp->salary); } // function to create a pointer of employee type struct employees *createEmployee() { // creating the pointer struct employees *emp = malloc(sizeof(struct employees)); // function to read the data readEmployee(emp); // returning the data return emp; } // function to print the employee data to console void display(struct employees *e) { printf("%s",…//below is the code I need help with answering the questions in the image// #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; // function to read the employee data from the user void readEmployee(struct employees *emp) { printf("Enter name: "); gets(emp->name); printf("Enter ssn: "); for (int i = 0; i < 9; i++) scanf("%d", &emp->ssn[i]); printf("Enter birth year: "); scanf("%d", &emp->yearBorn); printf("Enter salary: "); scanf("%d", &emp->salary); } // function to create a pointer of employee type struct employees *createEmployee() { // creating the pointer struct employees *emp = malloc(sizeof(struct employees)); // function to read the data readEmployee(emp); // returning the data return emp; } // function to print the employee data to console void display(struct employees *e) { printf("%s",…//below is the code I need help with answering the questions in the image// #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; // function to read the employee data from the user void readEmployee(struct employees *emp) { printf("Enter name: "); gets(emp->name); printf("Enter ssn: "); for (int i = 0; i < 9; i++) scanf("%d", &emp->ssn[i]); printf("Enter birth year: "); scanf("%d", &emp->yearBorn); printf("Enter salary: "); scanf("%d", &emp->salary); } // function to create a pointer of employee type struct employees *createEmployee() { // creating the pointer struct employees *emp = malloc(sizeof(struct employees)); // function to read the data readEmployee(emp); // returning the data return emp; } // function to print the employee data to console void display(struct employees *e) { printf("%s",…#include <iostream>#include <string>#include "hashT.h" using namespace std; class stateData{ friend ostream& operator<<(ostream&, const stateData&); // used to print state data on screen friend istream& operator>>(istream&, stateData&); // used to load data from file public: // setting values to the class object void setStateInfo(string sName, string sCapital, double stateArea, int yAdm, int oAdm); // retrieving data with call-by reference from the class object void getStateInfo(string& sName, string& sCapital, double& stateArea, int& yAdm, int& oAdm); string getStateName(); //return state name string getStateCapitalName(); //return state capital's name double getArea(); //return state's area int getYearOfAdmission();//return state's admision year int getOrderOfAdmission();//return state's order of admission //print stateName,…rografmiming CSC 101 Introduction VB Bau Section21436.02. Sntinn 2022 ta46581 OPRIV NEXTO Workbench Exercise 40443- deadne 04020022 1150 PM WORK AREA toThePowerOf is a function thet accepts two int parameters and returns the value of the first parameter raised to the power of the second. An int variable cubeside has aiready been deciared and initialized. Another int vaciable, cubevolume, has already been declared. Write a statement that calls toThePowerof to compute the value of cubeside raised to the power of 3, and store this value in cubevolume. SUBMIT 1 of 1: Sat Apr 02 2022 23:03:03 GMT-0400 (Eastern Dayilght Time) Type your selution here.code rectangel #include <iostream> using namespace std; class Rectangle{ private: double width; double length; static int numberOfObjects; public: Rectangle(); Rectangle(double , double); ~Rectangle(){cout<<"Destructor called "<<endl;} static void printNumberOfObjects(){ cout<<"number of objects: "<<endl;} void setDimention(double, double); double getWidth(); double getLength(); double getArea(); void printRectangle() const ; double getPerimeter(); }; int Rectangle::numberOfObjects=0; Rectangle::Rectangle(){ /*width = 0; length = 0;*/ cout<<"Default constructor called"<<endl; setDimention(0,0); numberOfObjects++; } Rectangle::Rectangle(double w, double l){ /* if(w>=0)// validation on the input width= w; else width=0; if(l>=0) length = l; else length= 0;*/ cout<<"constructor with parameters called"<<endl; setDimention(w,l); numberOfObjects++; } void Rectangle::setDimention(double W, double L){ if(W>=0)// validation on the…