Write an if-else statement to describe an object. Print "Balloon" if isBalloon is true and isRed is false. Print "Red balloon" if isBalloon and isRed are both true. Print "Not a balloon" otherwise. End with newline. (Notes) 345154 2174782 qx3zqy7 1 #include 2 using namespace std; 3. 4 int main() { bool isRed;
Q: 7) ( )If we define variables: int a=2, b-4, c-6; the value of the following expression ((a> b? a: b)…
A: The required code has ternary operators (denoted by '?' which is short form of if-else) and thus are…
Q: a) Briefly explain the parameters (e1, e2, distanceX, and distanceY) in the onScroll callbacks.…
A: To detect the user gesture Gester Detector is use. It android there is also have the gesture…
Q: QUESTION 4 5 points Save Answer Assume myString and newString are variables of type string already…
A: Given Data mystring="England" newstring=" " one line code is :…
Q: T/F The println method on System.out is overloaded
A: T/F Question. The println method on System.out is overloaded
Q: Complete the function to replace any period by an exclamation point. Ex: "Hello. I'm Miley. Nice to…
A: Algorithm:1. Start the Program and include the header files.2. Read the Input: It reads the input…
Q: using System; using System.Linq; using System.Text; namespace Games; { class Program { staticvoid…
A: GIVEN: using System; using System.Linq; using System.Text; namespace Games; { class Program {…
Q: please. Correct and detail answer will upvoted else downvote. There are one feline, k mice, and…
A: Here have to determine about c++ code for problem of save more mice statment.
Q: Question 1: (Select geometric figures) Write a program that draws a rectangle or an oval, as shown…
A: “Since you have posted multiple questions, we will provide the solution only to the first question…
Q: #include using namespace std; void myfunction(int num2,int num1); int main(){ myfunction(5,2);…
A: Please find the answer below :
Q: Q.1) Write a java program with class name Geometric. The program will calculate the area of Square,…
A: I give the code in java along with output screenshot
Q: Compare if else and switch case. Explain these statements with its general syntaxes and flow charts.
A: As per the question we have to compare the below conditional statements : if else switch case
Q: #include using namespace std; void myfunction(int num2, int nu int main(){ myfunction(5,2); return…
A: Function declaration is done in the third line saying myfunction accepts two integer parameters and…
Q: #include using namespace std; int main() { int specialNum; cin » specialNum; if (/put your answer…
A: specialNum == 0 || specialNum == -99 || specialNum == 44 This Expression should be filled to…
Q: Each of the following definitions and program segments has errors. Locate as many as you can and…
A: void showValues(int nums[ ]) *// Definition of the function showValues. { for (int…
Q: Using the string T = “EVERY GOOD BOY DESERVES FAVOUR”, find the following: SUBSTRING(T,24,6)//” “//…
A: Task :- find out the substrings for given string .
Q: Void Do1 (int: &, a. int &b) { a = 5; a = a + b; b = a + 2; } Int main() {…
A: We have given a C++ code and in which pass variable by reference. Here, integer variable x pass by…
Q: What is the value of x after the following statements are executed
A: Explanation: The switch statement is a multiway branch statement that allows a value to change the…
Q: T/F 9) The assignment statement d = p; is legal even though d is not a Poodle.
A: Please find the answer to the above question below:
Q: Correctly overloaded methods must have identifier
A: Introduction: Below describe the which option is correct and why Correctly overloaded methods must…
Q: int x; x=-2; do { x++; cout0); cout<<"done";
A: This is a while statement code
Q: Write an if-else statement to describe an object. Print "Balloon" if isBalloon is true and isRed is…
A: #include <iostream>using namespace std; int main() { bool isRed; bool isBalloon; cin…
Q: #include using namespace std; int main() int length, width, area; area - length • width; length -…
A:
Q: Implement the following: Given: item1="Pens" item2 = "Pencils" pricel = 0.99 price2= 1.5 Print two…
A: Dear student, the answer is provided below.
Q: 37. #include <s nt main() { int num = 5; hui %3D printf(" The v
A: Explanation: In given we are trying to print the integer variable here "%d" refers to that we are…
Q: C++ Code Only: There are two A, B players playing the game. Player A has a string on him, and Player…
A: Input/Output: The first line of the input contains an integer T, corresponding to the number of…
Q: The following code has a syntax error immediately before the word else. What is the error and why…
A: This has a syntax error basically same for every language. I have told the error in C++,Java and C…
Q: 9-The script in the left side is used to solve the right-side equation.
A: true
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- #include <stdlib.h> #include <time.h> #include <stdio.h> int main(void){ int money_start, bet, money_bet; int money_result; int randomNumber = 0; int n = 0; srand(time(0)); randomNumber = rand() % n; printf("Entering the casino, how much money do you have? "); scanf("%d", &money_start); printf("We are playing roulette, odd or even bets only.\nPlace your bet!"); printf("Enter 1 for odd, 2 for even, 0 to quit: "); scanf("%d", &bet); printf("How much money do you want to bet? "); scanf("%d", &money_bet); while (( bet == 1 || bet == 2 )) { if (( bet == 1)) { printf("You bet $%d on odd numbers.", money_bet); if ((randomNumber % 2 == 0)) { money_result = money_start - money_bet; printf("You lose!"); printf("Your balance is $%d!", money_result);} else { if ((randomNumber…Q2: (Debugging Code) : As you are learning to program in C, you will often spend a lot of time debugging code and finding errors. It takes a lot of practice to develop this skill. There are many errors in the following program. Find and correct all the errors so that the program compiles and produces the correct output. (Add a new comment on line 1 of the code and list the errors.) Find all the errors challenge * include1) please someone help me ,based on the program given how can i add two extra features to the program. to show what packages is most people to buy . to show the total of customer . #include <stdio.h>#include <stdlib.h>#include <string.h>#pragma warning(disable : 4996) int main(void){ //Package category arraychar category[]= { 'A', 'B', 'C', 'D' };//Price arrayfloat price[] = { 24.50, 26.00, 27.50, 29.00 };//Quantiy arrayint quantity[] = { 0, 0, 0, 0 };int count = 1;int qtyA = 0, qtyB = 0, qtyC = 0, qtyD = 0;float total = 0.0, discount = 0.0, delivery = 0.0, net = 0.0;char ch = 'A', choice = 'Y';int p = 0;char name[50], ic[20], addr[100]; printf("\n<MENU PRICES OF VEGETABLE>");printf("\n===============================================================================");printf("\n MR.KOK VEGETABLE ORDERING SYSTEM");printf("\n===============================================================================");printf("\n Packages \t\t\t\t Price ");printf("\n A…Write an if-else statement to describe an object. Print "Balloon" if isBalloon is true and isRed is false. Print "Red balloon" if isBalloon and isRed are both true. Print "Not a balloon" otherwise. End with newline. (Notes). Learn how our autograder works 487972.3377318.qx3zqy7 1 #include 2 using namespace std; 3 4 int main() { 5 6 7 8 9 10 11 12 13 14} bool isRed; bool is Balloon; cin >> isRed; cinisBalloon; /* Your solution goes here */ return 0; 1 test passed All tests passedC++++Identify and correct the error int main(void) { double x = 12.8 double y Follow the code.Q1// find the value of x ? # include main () { Int x,y,z ; X=y=z=0 X= ++y + ++z ; Cout<Find the illegal statement, correct them and provide justification. a) void fun(int x = 1, int z, int y = 1 ); void fun(int x = 1, int y , int z = 1); void fun(int z, int y); void fun(int z = 1, int y = 1); b) #include<fstream> using namespace std; void fun(int b,int x, int a = 3 ) { int sum = b+x+a; cout<<sum; } main() { fun(7); fun(7,8); fun(); } c) ifstream of(“test.dat”,ios::binary); of.seekp(4); of.seekg(4);1 using System; 2 using System.Text; 3 class Program { staticvoid Main(string[] args) { int choice,games_choice; Console.WriteLine("You are on a quest for a rare flavor of chips you saw on an ad. The inside of the bag has an invaluable prize that could change your life forever. You decide to dedicate today to find that bag of chips. Do you go to Walmart or Costco first?"); Console.Write("Press 1 for 'Walmart' or Press 2 for 'Costco'\n"); choice = int.Parse(Console.ReadLine()); if(choice==1) { Console.WriteLine("You begin your meticulous search in the isles of the Walmart Supercenter only to find an empty display of the newly released rare flavor of chips. Out of the corner of your eye you see a nearby shopper with three bags of those rare chips in her basket casually strolling along. Craziness pops in your head and you have to make a quick decision. Your first option is to ask her nicely for one of the bags but that just seems far fetched. Your second option is to challenge her to a…19- Correct the following code. Keep the first line of code (double getValue () () double getValue() { double x = 5.1; return x; } int main() ( 3 C++ cout<SEE MORE QUESTIONSRecommended textbooks for youDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSONC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag…Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill EducationDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSONC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag…Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education