Write, compile, and test a program named Lyrics that displays at least four lines of your favorite song using C++ programming language. Please make sure to utilize code " (\s*WriteLine\(".*"\);\s*){4,} " in your solution. Please use the code provided below as the base code for your solution. Code: using static System.Console; class Lyrics { staticvoidMain() { // Write your main here } }
Q: What will be the output of the following C# code? class A { public virtual void display() {…
A: Question. What will be the output of the following C# code? class A{public virtual void…
Q: In Java only please. The following progam uses a series to find the approximate value of pi.…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: Consider the following code snippet [Pseudocode]: Method func) { PRINT "This is not an main…
A: Answer 1. The code will show compile time error. Answer 2. The code will show compile time error.
Q: In python -Once upon a time in the Land of Apples, John had three apples, Mary had five apples,…
A: The description is as- Taking 3 variables juan, maria, adan and storing 3,5,6 apples respectively.…
Q: Write a program that allows a player to play Rock, Paper, Scissors. In this version, if there is a…
A: Find the required code in python as language not mentioned given as below and output :
Q: This is a debugging question I am struggle with - The files provided in the code editor to the…
A: In "DebugTen1.java" file, The function name should be "main()", and not "mane()". The function…
Q: please help me with this c++ code, and I did not understand why the output is x=10 y=20. Please…
A: The above code is a simple example of chaining of function calls. The C++ code has used an object to…
Q: est (int x = 0, int y = 0) { this->x = x; this->y = y; } Test setX(int a) { x = a; return *this; }…
A: When return a plain object rather than a reference, then returning a copy of the object on which…
Q: What is the output of the following program? #include #include using namespace std; class A {…
A: To do: Output of the given code:
Q: The files provided in the code editor to the right contain syntax and/or logic errors. In each case,…
A: 1. The first while-loop was not closed. 2. It will be java.lang.Math.random() instead of…
Q: There are 3 parts to this question. Please give me the code for all the 3 parts. Any kind of help…
A: Actually, string is a sequence of characters.
Q: I keep getting the error "undefined reference to 'main'". What am I doing wrong? Here is the code,…
A: #include <stdio.h>#include <stdlib.h>#include <string.h> int main(){char…
Q: write a python application that can verify that the email has the corect Syntax. For example, that…
A: def isValid(Email): if Email.find(" ") != -1: return False if Email.find("@") == -1:…
Q: What will be the output of the following program in C++? #include using namespace std; class Test…
A: Given, Code: #include <iostream> using namespace std; class Test { static int x; public:…
Q: 1.) Write constant declaration for the following: - A public variable that is used to measure…
A: Declaration of constant in java programing Constant name defined in java.lang.math need of…
Q: determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it…
A: Error Correction Reason while(day > DAYS); while(day > DAYS) After while loop, don't…
Q: Here is the question: The files provided in the code editor to the right contain syntax and/or…
A: public class Main{ public static void main(String[] args) { String quote = "Honesty is the…
Q: I formed this code but i'm not good at making object oriented c++ code. could someone help me turn…
A: The program is in C++ . For making your project as header and driver part, you have to make the…
Q: Consider the definition of the class integerManipulation . What is the output of the following C++…
A: Explanation: In the given code, the function “classifyDigits()” is used to count the total number of…
Q: Write an application that accepts three Strings from the user and displays them in alphabetical…
A: Introduction of the Program: The Java Program takes three strings from the user as input then the…
Q: Write a piece of Java code that will have a loop that counts the number of space characters that…
A: Loop is a control flow statement that executes a block of code in the loop until the condition of…
Q: In right triangle ABC below, angle C is 90 degrees, side a = 48 , and side c = 73. Write a Java…
A: Program42.javaIn right triangle ABC below, angle C is 90 degrees, side a = 48 , and side c = 73.…
Q: Question 1: With Java, Write a program that will ask the user to enter the following personal…
A: Scanner class is used for read input from user. Note: As per our guidelines we are supposed to…
Q: using System; class Program { publicstaticvoid PrintBoard() { Console.WriteLine(" X | | ");…
A: Required: Hello! This program is in C# to play a simple tic tac toe game with the user vs. computer.…
Q: Write a program to develop a calculator using C# Programming skills ram will ask the user to enter…
A: main.cs using System;class HelloWorld { static void Main() { int num1; int num2;…
Q: The following code is in Java: Assume the following declaration exists: enum Coffee { MEDIUM,…
A: Lets analyse the given code for errors: Coffee myCup = DARK;//error, enum constant directly…
Q: Write a C++ application that will allow the user to order the Pizza. For the pizza, it could be…
A: Given : topping price are given vegetarian topping=0.25 meat topping=0.50…
Q: using System; class Program { // Define PrintBoard method public static void PrintBoard()…
A: Given: using System; class Program{ // Define PrintBoard method public static void…
Q: hello! can you help debug my Java program? here are the errors I am getting: line 67: id cannot be…
A: Errors in the program: The size of the Account object should be 500 because it loop will check the…
Q: he twins Kartik and Kunaal want to play word search puzzles with their class. They want to be faster…
A: • check all cells. If a cell has the first letter, we will then try all 8 directions one by one from…
Q: Please try to do fast Write the output of the following C++ code? #include using namespace…
A: Que. Write the output of the following C++ code? Ans. Given, Programming language = C++ language…
Q: What is the output of the following code? #include using namespace std; class P { public: void…
A: In the given code we have first of all the base class P and the child class of P is Q. Next, class Q…
Q: 8 Write a application that recites a usual of numbers, and then bargains and designs the amount of…
A: Write a application that recites a usual of numbers, and then bargains and designs the amount of the…
Q: Use a class named Character with string variables fullname, weapon, vision, and integer variables…
A: Given :
Q: ou are said to store data of Hospitals in a city. For that purpose, you are asked to develop a…
A: You are said to store data of Hospitals in a city. For that purpose, you are asked to develop a…
Q: By using class interface write a program to read three numbers and using a friend function to find…
A: Algorithm: Start Define a class with one virtual method and one friend method. Implement the 2…
Q: Here is the question: The files provided in the code editor to the right contain syntax and/or…
A: public class DebugSeven4{ public static void main(String[] args) { String aString = "HELP!!…
Q: Question 12 Consider the following program written in C pseudocode: void foo(int x, int y){ y = y +…
A: Please give positive ratings for my efforts. Thanks. ANSWER a) Passed by value a = 6…
Q: 3) Write a Java program that prompts the user to enter a sentence (phrase), then it counts how many…
A: Please find the answer below :
Q: (3) Write a Java program that prompts the user to enter a sentence (phrase), then it counts how many…
A: import java.util.*;/*Name : K,KASI REDDY * STUDENT NO.123 */public class Main { public static…
Q: A programmer notices the following two procedures in a library. The procedures do similar, but not…
A: Given Procedure MaxTwo (x, y) returns the greater of its two integer parameters. Procedure MaxThree…
Q: a) What is blank or uninitialized final variable? How to initialize blank final variable? b) What is…
A:
Q: #include #include #include #include #include #include "card.h" #include "deck.h" #include…
A: Programming is a way to instruct the computer devices to operate. Every computer needs a set of…
Q: What is the output of the following C++ code? #include using namespace std; class class0 {…
A: Given: What is the output of the following C++ code? #include <iostream> using namespace std;…
Q: This is a debugging problem that I have changed some but still not getting it. This is the problem -…
A: Introduction of Program: In this Program, it is clear that if ( item <111) then the program will…
Q: Decide which of the following statements is either true or false and re-correct the false ones. 1.…
A: Note: Since you have asked multiple questions we will solve only few questions for you and if you…
Q: A programmer notices the following two procedures in a library. The procedures do similar, but not…
A: Procedure MaxFour (w,x,y,z) which returns the greatest of its four integer parameters is the…
Q: What will be the output of the following C# code? class a { public void fun() {…
A: Given: using System;class a { public void fun() { Console.WriteLine("base…
Addition of Two Numbers
Adding two numbers in programming is essentially the same as adding two numbers in general arithmetic. A significant difference is that in programming, you need to pay attention to the data type of the variable that will hold the sum of two numbers.
C++
C++ is a general-purpose hybrid language, which supports both OOPs and procedural language designed and developed by Bjarne Stroustrup. It began in 1979 as “C with Classes” at Bell Labs and first appeared in the year 1985 as C++. It is the superset of C programming language, because it uses most of the C code syntax. Due to its hybrid functionality, it used to develop embedded systems, operating systems, web browser, GUI and video games.
Write, compile, and test a program named Lyrics that displays at least four lines of your favorite song using C++
Code:
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- Code in C++ Language As a cashier, you would always hate those times when customers choose to take back their order since you'd always summon your manager and yell, "Ma'am pa-void!" No matter how you hate it, you always have to do it since you have no other choice. Given (1) an array of prices of the items, (2) another array of the items the customer wishes to take back, and (3) the customer's payment, print the change of the customer. Input: The first number indicates the number of items "n" brought to the cashier. The next "n" numbers are the prices of the items. The next number indicates the number of items "m" that the customer wants to take back and not proceed. It is assured that 0 <= m <= n. The next "m" numbers are the items to be void that ranges from item 1 to item "n". The final number is the customer's payment. It is also assured that the given payment >= final price of items. INPUT: 5 103.65 650.95 10.25 1067.30 65.18 2 1 5 2000.00 Output: The change…Language: JAVA Keep Guessing Write a program that plays a number-guessing game to guess a secret number randomly generated within the range 1 and 10. The user will get as many numbers of tries as he/she needs to guess the number. Tell the users if their guess is right or wrong and if their guess is wrong let them try to guess the number again. You must generate the secret number using the Java Random class. When the user guesses a number he/she will have to take an input of his guessed number from the keyboard. The user will have to take as many inputs as needed to guess the correct secret-number. That means the code will keep looping as long as the guess is different from the secret number. Use a while loop to prompt the user to guess again if the guess is wrong. Create a class named NumberGuessingGame which will contain the main method, write all your code in the main method. Sample input and output: Suppose the random number generated is 6. I have chosen a number between 1…I need help for Microsoft Visual C#, 7th edition, chapter 5 debugging exercise 5-2 // Program asks user to enter a stock number // If the stock number is not 209, 312, or 414 the user must reenter the number // The program displays the correct price using System; using static System.Console; using System.Globalization; class DebugFive2 { static void Main() { const string ITEM209 = "209"; const string ITEM312 = "312"; const string ITEM414 = "414"; const double PRICE209 = 12.99, PRICE312 = 16.77, PRICE414 = 109.07; double price; string stockNum; Write("Please enter the stock number of the item you want "); stockNum = ReadLine(); while(stockNum != ITEM209 || stockNum != ITEM312 || stockNum != ITEM414) { WriteLine("Invalid stock number. Please enter again. "); stockNum = ReadLine(); } if(stockNum == ITEM209) price = PRICE209; else if(stockNum == ITEM312) price…
- IN C# PLEASE Create class Cube. The class has attributes length and width and depth, each of which defaults to 1. It has read-only properties that calculate the Perimeter and the Area for a side of the cube, and another that calculates the cubed feet for the cube. (You will have to research how to do that calculation online) It has properties for length and width and depth. The set accessors should verify that length and width and depth are all floating-point numbers greater than 0.0 and less than 20.0. Write an app to test class Cube by creating 3 cubes of different sizes.? ParameterMysteryExam1 ♡ Language/Type: Java parameters return The following console program uses parameters and produces five lines of output. What are they? public class ParameterMysteryExam1 { } public static void main(String[] args) { String x = "java"; String y = "tyler"; String z = "tv"; String rugby = "hamburger"; String java = "donnie"; } hamburger (x, y, z); hamburger (z, x, y); hamburger ("rugby", z, java); y = hamburger (y, rugby, "x"); hamburger (y, y, "java"); and " + x + ” like + y); System.out.println(z + public static String hamburger (String y, String z, String x) { return z; } 9 M 31 mWrite an C++ that uses a class called “Book” (see details below). The application must perform the following tasks. Create an array of “Book” objects (i.e., array must be able to store 2 books). Create 2 “Book” objects initialized as follows. o title = “C++ Textbook”; Author = “Pete Parker”; Publisher = “Cengage”, ISBN = “0123456789”; subject = “Computer Programming”; o title = “Java Textbook”; Author = “Bruce Wayne”; Publisher = “McGraw Hill”, ISBN = “9876543210”; subject = “Computer Programming”; Add the two books to the array. o Assume the two publishers have merged into a new company called “BookConglomerate”. Use a loop to create statements to modify the publisher field with the new publisher name. Display the following information for both books o Book Title (i.e., “C++ Textbook” or “Java Textbook”) o Author o Publisher o ISBN o Subject The Book class must contain the following. Constructor with parameters that initialize all instance variables title, author,…
- - Challenge Activity 1: Stadium Seating Revenue Calculation Tool There are three seating categories at a stadium. Class A seats cost $20, Class B seats cost $15, and Class C seats cost $10. Write a program (a GUI program) ON *PYTHON*that asks how many tickets for each class of seats were sold, then displays the amount of income generated from ticket sales.in C# errors are in pics class Program { static void Main(string[] args) { Bank myBank = new Bank(); // Adding bank accounts BankAccount account1 = new BankAccount { AccountNumber = "001", AccountHolderName = "John Doe", Balance = 5000, AccountType = AccountType.Savings }; myBank.AddAccount(account1); BankAccount account2 = new BankAccount { AccountNumber = "002", AccountHolderName = "Jane Smith", Balance = 10000, AccountType = AccountType.Current }; myBank.AddAccount(account2); BankAccount account3 = new BankAccount { AccountNumber = "003", AccountHolderName = "Bob Johnson", Balance = 7500, AccountType = AccountType.Savings }; myBank.AddAccount(account3); // Searching for an existing account and displaying its details Console.WriteLine("Enter the account number to search: "); string accountNumber = Console.ReadLine(); BankAccount foundAccount =…The following question deals with Object Oriented Programming in Python Pseudocode into a flowchart. The question: Design a class named Pet, which should have the following fields: name- holds name of the pet type-holds the type of animal the animal age-holds age of animal The Pet class should also have the following methods: setName: stores string value in the name field setType: stores string value in the type field setAge: stores integer value in age field getName: returns value of the name field getType: returns value of the type field getAge: returns value of the age field. Once you have created the class, design a program in flowchart form that creates an object of the class and prompts the user to enter the name, type, and age of his or her pet. This data should be stored in the object. Use the object's accessor methods to retrieve the pets name, type, and age and display this data on screen. Also, the class methods should each be illustrated as separate functions. The…
- What will this code print? def fun_a(): print("aa") def fun_b(): print("bb") def fun_c(): print("cc") def main(): fun_c() fun_a() fun_b() fun_c() main()Lab9B: Lab9A, but now with more math For this exercise you will be writing a program that will be building upon the previous program. So please make a new class file, copy, and rename the code you have already written for Lab9A. Please also remember to rename the file and (and in the case of Java and C# students) class name to Lab9B. For this exercise, please calculate two values from all of the numbers in the two dimensional array. The first value should be the sum of all numbers in the array. This should be stored in a separate "int" variable that is created outside the nested FOR loops. The second value should be the total average of all numbers in the Array. This should be stored in a separate "float" variable, also outside the nested FOR loop structure. So, in short: • Display the sum of the values in the array • Then display the average of the values in the array Please refer to the sample output below for visualization and match its style. As always: Remember, the class name…Please use C++ Create an application named SalesTransactiobDemo that declares several SalesTransaction objects and displays their values and their sum. The SalesTransaction class contains the following fields:Name - The salesperson name (as a string)salesAmount - The sales amount (as a double)commission - The commission (as a double)RATE - A readonly field that stores the commission rate (as a double). Define a getRate () accessor method that returns the RATEINCLUDE three constructors for the class. On constructor accepts values for the name, sales amount, and rate, and when the sales value is set, the constructor computes the commission as sales value times commission rate. The second constructor accepts a name and sales amount, but sets tge commission rate to 0.The third constructor accepts a name and sets all the other fields to 0.An overloaded + operator adds tge sales values for two SalesTransaction objects and returns a new SalesTransaction object.In order to prepend the $ to the…