//What is the output of this program? #include #include using namespace std; int main(){ int i = 1.123456; cout<
Q: Now, modify it to do the following: modify the while loop to utilize tolower() or toupper().
A: Hi There, Please find your solution below, I hope you would find my solution useful and helpful. I…
Q: #include using namespace std; int Fibonacci(int n) { /* Type your code here. */ } int main() {…
A: Required c++ code according to template provided is given below:
Q: #include using namespace std; class Box { Public: int length, width, sum, sub, div; Box…
A: The given program is written in the c++ programming language. It can be executed in any one of the…
Q: for this code pls make a pseudocode or a flow chart #include #include #include #include…
A: C++ is a general-purpose programming language that was developed as an extension of the C…
Q: nclude ing namespace std; ol Facto(int* pSquared, int* pCubed, int n); t main() int number,…
A: Given code contains the functions calling and called. Those contains the methods squared and cubed…
Q: #include void main() { int i; int number[11]={12,15,17,3,2,7,10,10,15,15,50}; for(i=0;i< 11; i++){…
A: Over here array is given which has 11 elements and we have to find a Maximum, Minimum, and average…
Q: #include #include using namespace std; int main() { double weight, distance; double…
A: Hello student Greetings Hope you are doing great Thank You!!!
Q: //Please Fix this program #include using namespace std; class student { int snum; char sname[20];…
A: We have a C++ program and we need to fix the issues in this program.
Q: Modify the while loop to utilize tolower() or toupper(). Add default values to the to_celsius() and…
A: #include <iostream>#include <cmath>#include <cctype> // contains tolower function…
Q: C++ collatz sequence not compiling #include using namespace std; int main() { int initial; int…
A: Please refer to the following steps for the complete solution to the problem above.
Q: Complete the code: string cars[5] = {"Volvo", "BMW", "Ford", "Mazda", "Honda"}; for(int i = 0; i< _;…
A: string cars[5]={"Volvo","BMW","Ford","Mazda","Honda"}; for(int i=0;i<5;i++){…
Q: //Please fix this program #include #include using namespace std; template void calculate() { float…
A: Basic knowledge of c++ templates is required to solve this problem. Follow the correct code with…
Q: Computer Science What statement is true about the following C Program? #include #include…
A: Hello student Greetings The given code snippet presents a program that deals with soccer game data…
Q: include #include using namespace std; int main() { double weight, distance; double…
A: According to the Question below the solution: Output:
Q: #include <iostream using namespace st int main() int s-4; int d-s++3; cout<<d; return 0;
A: Given Code: #include <iostream>using namespace std; int main(){ int s = 4; int d = s++;…
Q: ude #include #include using namespace std; class VideoGame { public: string title, genre,…
A: It is defined as a powerful general-purpose programming language. It can be used to develop software…
Q: Please explain this code: #include #include using namespace std; int main() { char…
A: This is C++ code. In this question, we have to explain the code. In the end we will also attach the…
Q: Please Explain this code: #include #include using namespace std; int main() { int size =…
A: C ++ code to find standard deviation and mean is explained with output
Q: Explain this C code line per line please #include #include void printArray(int**,…
A: #include<studio.h>//defining header file # include <malloc. h>//header file for…
Q: #include #include using namespace std; int main() { double weight, distance; double…
A: Hello student Greetings Hope you are doing great Thank You!!!
Q: Hello i keep getting this error?? im not user where i went wrong? it just keep added more? thank you
A: #include <stdio.h> # include <stdlib.h> int input(); void multiples(); void coins();…
Q: #include #include using namespace std; int main() { double weight, distance; double…
A: This program calculates the package rates from weight of the package and distance the package will…
Q: Write a function called deleteRepeats that has a partially filled array of characters as a formal…
A: To delete repeated characters from a character array.
Q: Code in c language, please. Thank you in advance. Assign listOfPizzas's first element's…
A: Assign listOfPizzas's first element's numberOfCalories with the value in listOfPizzas's second…
Q: let me enter the number of fork but only 1 character can be enter in the username. If I type…
A: Code is working perfectly in all scenarios. #include <stdio.h>#include…
Q: #include /* print Fahrenheit-Celsius table for fahr = 0, 20, ..., 300; floating-point version /…
A: Given: We need to update the code to use the for loop. The code is given below:
Q: 2.20 LAB: Hypotenuse Given two numbers that represent the lengths of a right triangle's legs (sides…
A: Introduction: The name "Hypotenuse" in mathematics derives from the Greek word hypoteinousa, which…
Q: #include #include #include #define EMPS_SIZE 20 #define SSN_SIZE 9 #define MAX_EMPS 19…
A: Define the Employee struct to hold information about each employee, including name, salary, year of…
Q: For the following code #include #include int powerof(int base, int pow); int _tmain(int argc,…
A: powerof is a function that takes two parameters base and pow
Q: when i run my code why does it keep add more cents when e.g? 30 cent50 : 2 cent20 : 5 cent10 : 1…
A: //// main.c// Assignment1//// Created by Hassan omer on 15/10/21.// #include <stdio.h>…
Q: #include #include using namespace std; class Fraction { public: int numerator; int…
A: Output of the given Program: The product of 9/8 and 2/3 is 18/24 The quotient of 9/8 and 2/3 is…
Q: complete and create magical square #include using namespace std; class Vec { public: Vec() { }…
A: #include <iostream> using namespace std; class Vec { public: Vec() { } int size() { return…
Q: Add screenshots of outputs as well Execute the following example and write a comment after each…
A: The code after adding the comments is as follows: #include<iostream> #include<string>…
Q: In C++ Find the five errors. For each error, state the line number, explain the error and show a…
A: Answer:)
Q: Create two more functions (options #3 and #4 in your menu) by taking the to_celsius() and…
A: C++ program for the above two problems :
Q: Convert the follwoing code into a object-oriented programming (OOP) application using secure and…
A: NOTE: - Any modification to variables being declared or logic of the program is not done. The input…
Q: Write a function getNeighbors which will accept an integer array, size of the array and an index as…
A: An integer array, its size, and an index are sent to the C++ function getNeighbors, which returns a…
Q: 1. Trace the following program and fill in the values of the involved variables in the for loop of…
A: GIVEN:
Q: Main.cpp #include #include "Deck.h" int main() { Deck deck; deck.shuffle();…
A: Main.cpp #include <iostream>#include "Deck.h" int main() { Deck deck; deck.shuffle();…
Q: For the following code #include #include int powerof(int base, int pow); int _tmain(int argc,…
A: Answer :- The pow() function is used to find the power of a given number. It returns x raised to the…
Q: #include using namespace std; struct item { int id; float price; } s[50]; int size=0;…
A: Algorithm: for (initialExpression; testExpression; updateExpression){ // body of the…
Q: Convert following C++ code to C: #include using namespace std; char board[3][3] =…
A: Converted c code: #include <stdio.h>#include <stdbool.h>char board[3][3] =…
Q: #include using namespace std; int main() {char names [18][8]={"saif", "4", "8", "hussain", "5","2",…
A: In the given c++ program
Q: #include #include using namespace std; int main() { double weight, distance; double…
A: We need to change the coding to minimum rate 1-499kg is RM14.85.
Q: dentify the syntax errors in the given code. #inclode using name space std; int factorial(int x);…
A: Given code: #inclode<iostream>using name space std;int factorial(int x); int factorial(int x)…
Q: Consider the following C++ codes: Code a: Code b: int x-8; // global void func () int x-8; // global…
A: Let us see the details below,
Q: Main.cpp #include #include "Deck.h" int main() { Deck deck; deck.shuffle();…
A: Here are the UML class diagrams for the three classes:
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- C++ complete magic Square #include <iostream> using namespace std; /*int f( int x, int y, int* p, int* q ){if ( y == 0 ){p = 0, q = 0;return 404; // status: Error 404}*p = x * y; // product*q = x / y; // quotient return 200; // status: OK 200} int main(){int p, q;int status = f(10, 2, &p, &q);if ( status == 404 ){cout << "[ERR] / by zero!" << endl;return 0;}cout << p << endl;cout << q << endl; return 0;}*/ /*struct F_Return{int p;int q;int status;}; F_Return f( int x, int y ){F_Return r;if ( y == 0 ){r.p = 0, r.q = 0;r.status = 404;return r;}r.p = x * y;r.q = x / y;r.status = 200;return r;} int main(){F_Return r = f(10, 0);if ( r.status == 404 ){cout << "[ERR] / by zero" << endl;return 0;}cout << r.p << endl;cout << r.q << endl;return 0;}*/ int sumByRow(int *m, int nrow, int ncol, int row){ int total = 0;for ( int j = 0; j < ncol; j++ ){total += m[row * ncol + j]; //m[row][j];}return total; } /*…C++ Find the errors in the code for Date Class and Source.cpp program and fix them. source.cpp include <iostream>#include "Date.h" // include definition of class Date from Date.h using namespace std; // function main begins program executionint main(){Date date(); // create a Date object for May 6, 1981 // display the values of the three Date data members cout << "Month: " << date.getMonth() << endl;cout « "Day: " << date.getDay() << endl;cout << "Year: " << date.getYear(2017) << endl; cout << "\nOriginal date:" << endl;date = displayDate(); // output the Date// modify the Date setMonth(13);setDay(1);setYear(2005); cout "\nNew date:" << endl;date.displayDate(); // output the modified date } // end main Date.h // class Data definition#include <iostream>using namespace std; //Data constructor that initializes the three data members;class Date{publicdate(m, d, y){setMonth();setDay();setYear();};// set monthvoid…Determine all the output from the following program as it would appear on the screen. void func1(int); void func2(int = 4, int = 5, int = 2); int func3(int &, int, int); %3D int main() { int x = 0, z = 0, y = 2; func1(y); cout << y << endl; func2(x, y, z); func2(); func3(x, y, z); = Z func1(x); cout << x << " " << y << " " << z << endl; return 0; } void func1(int b) { static int a;
- using c++ complete the code where it says , /* Your code goes here */ compute z= y- √2 #include <iostream>#include <cmath>#include <ios>#include <iomanip>using namespace std; int main() {double x;double y;double z; cin >> x;cin >> y; /* Your code goes here */ cout << fixed << setprecision(2); // This will output only 2 decimal places.cout << z << endl; return 0;}#include <iostream> #include <cmath> using namespace std; // declare functions void display_menu(); void convert_temp(); double to_celsius(double fahrenheit); double to_fahrenheit(double celsius); int main() { cout << "Convert Temperatures\n\n"; display_menu(); char again = 'y'; while (again == 'y') { convert_temp(); cout << "Convert another temperature? (y/n): "; cin >> again; cout << endl; } cout << "Bye!\n"; } // define functions void display_menu() { cout << "MENU\n" << "1. Fahrenheit to Celsius\n" << "2. Celsius to Fahrenheit\n\n"; } void convert_temp() { int option; cout << "Enter a menu option: "; cin >> option; double f = 0.0; double c = 0.0; switch (option) { case 1: cout << "Enter degrees Fahrenheit: "; cin >> f; c =…#include <iostream> using namespace std; int rectArea (int len, int wid) { return len * wid; } int main () { int length, width; cin >> length >> width; cout << "The area of a " << length << " by " << width << " rectangle is " << /*add code to call the reacArea function */ << "." << endl; return 0; }
- Transcribed Image Text #include<stdio.h> #include<string.h> #include<conio.h> #include<stdlib.h> int i; char n=1,username[16],password[ 30],ch; void welcome() { system ("@cls||clear"); printf("\t\tWECOME TO MY SITE\n"); } int main() { while(n<=3) { welcome(); printf("\n\NLOGIN HERE!"); printf("\n\nUSERNAME : "); scanf ("%s",&username); printf("PASSWORD: "); for (i=0;i<16;i++) { ch = getch(); if(ch==13) { password[i]='\0'; break; password[i]=ch; printf("*"); password[i]='\0'; printf("\n\n"); system("pause"); if(strcmp(username, "rolan")==0) if(strcmp(password, "12345")==0) { welcome(); printf("\n\NYOU'VE LOGIN SUCCESSFULLY!"); break; else welcome(); printf("\n\nWRONG PASSWORD. You have %d attempt/s left...",3-n); else welcome(); printf("\n\NUSER DOESN'I EXIST. You have %d attempt/s left...",3-n); getch(); n++; if(n==4) { welcome(); printf("\nSORRY! YOU CAN'T LOGIN."); break; getch(); } }Create a flowchart for this program in c++, #include <iostream>#include <vector> // for vectors#include <algorithm>#include <cmath> // math for function like pow ,sin, log#include <numeric>using std::vector;using namespace std;int main(){ vector <float> x, y;//vector x for x and y for y float x_tmp = -2.5; // initial value of x float my_function(float x); while (x_tmp <= 2.5) // the last value of x { x.push_back(x_tmp); y.push_back(my_function(x_tmp)); // calculate function's value for given x x_tmp += 1;// add step } cout << "my name's khaled , my variant is 21 ," << " my function is y = 0.05 * x^3 + 6sin(3x) + 4 " << endl; cout << "x\t"; for (auto x_tmp1 : x) cout << '\t' << x_tmp1;//printing x values with tops cout << endl; cout << "y\t"; for (auto y_tmp1 : y) cout << '\t' << y_tmp1;//printing y values with tops…Please fix this code for me, I'm stuck . #include<iostream>#include <iomanip>using namespace std;// the main bodyint main(){std::string item[10],name;int n;float price[10],ST_VAT[10],tax[10],total=0.0,Net;cout<<"Enter the number of items that should be atleast 5 : ";cin>>n;cout<<"Enter the customer's name ";cin>>name;for(int i=1;i<=n;i++){ std::cout<<"\nEnter the item "<<i<<" name , cost, sales tax and VAT :";cin>>name>>price[i]>>ST_VAT[i];tax[i]=price[i]+ST_VAT[i];total=total+tax[i];}Net=total-0.05*total;cout<<swet(5)<<"Food Stuff Grocery Shop"<<endl;cout<<"Customer Name"<<name<<endl;cout<<"ITEM"swet(8)<<"PRICE"<<swet(15)"Sales Tax+ VAT"<<swet(10)<<Sub-Total endl;cout<<SWET(8)<<"------------"<<swet(15)<<"--------------"<<swet(10)<<"----------"endl;for(int…
- C++ 6.34 #include <iostream>#include <cstdlib>#include <ctime>using namespace std; void guessGame(); // function prototypebool isCorrect( int, int ); // function prototype int main(){srand( time( 0 ) ); // seed random number generatorguessGame();} // end main // guessGame generates numbers between 1 and 1000 and checks user's guessvoid guessGame(){int answer; // randomly generated numberint guess; // user's guesschar response; // 'y' or 'n' response to continue game // loop until user types 'n' to quit gamedo {// generate random number between 1 and 1000// 1 is shift, 1000 is scaling factoranswer = 1 + rand() % 1000; // prompt for guesscout << "I have a number between 1 and 1000.\n" << "Can you guess my number?\n" << "Please type your first guess." << endl << "? ";cin >> guess; // loop until correct numberwhile ( !isCorrect( guess, answer ) ) cin >> guess; // prompt for another gamecout << "\nExcellent! You guessed the…#include <iostream>#include <cmath>#include <iomanip>using namespace std; int main() { double x; double y; double z; cin >> x; cin >> y; /* Your code goes here */ cout << fixed << setprecision(1); // setprecision(1) outputs z with 1 decimal place. cout << z << endl; return 0;} having trouble with this code in C++// Fix this program that works// Use welcome function that display the message in diffreent color// Use Draw function to diplay table in gree/yellow// Remove, add, any code that you believe is not useful#include <iostream>#include <windows.h> using namespace std;char mat[3][3];void table(); //function to print the tablevoid welcome(); //function for welcome screenint main(){ int i, j, m, n, sum = 0; char ch; welcome(); system("pause"); for (m = 0; m < 3; m++) for (n = 0; n < 3; n++) mat[m][n] ='W'; table(); while (sum < 10) { //================== for player 1 =================== cout << "Player 1 is X Choose the position : "; cout << "Row:"; cin >> i; cout << "Coloumn:"; cin >> j; //============== if position is wrong ============ for (; i > 3 || i < 1 || j>3 || j < 1 || ('x' == mat[i - 1][j - 1] || 'o'…