If the input is negative, make numltemsPointer be null. Otherwise, make numltemsPointer point to numltems and multiply the value to which numltemsPointer points by 10. Ex: If the user enters 99, the output should be: Items: 990
Q: C++ Language
A: Answer is in given below:-
Q: flag will be reset whenever the result is positive.
A: S(sign flag) will be reset whenever the result is positive.
Q: C cl *** clev ***** clevel clevela clevelan cleveland
A: Take string input from user. Run row loop till the length of the input string. Run column loop for…
Q: What values are returned by each of the following?a. Math.round(2.3)b. Math.round(2.7)c.…
A: Math.round() method In Java, the Math.round() function is used to round numbers to the nearest…
Q: A store is having a promotion where every item is on sale for 20% off. This means that the…
A: - Given question is to find out the missing percentages in the fields. Given , Store giving 20%…
Q: Consider the following code to answer below questions: public double calculatePerimeter(Shapes []…
A: Answer 1) In the above code violated, KISS Principle. KISS Stands for keep it simple and stupid…
Q: Please help!! I don't understand most of the code. Please leave comments as explanations on every…
A:
Q: which design principle is violated in the above code? what is the issue/ limitation of this code?…
A: Given Code: public double calculatePerimeter(Shapes [] shapes) { double p = 0;for…
Q: What will be the output of the following program when the button is clicked? Private Sub…
A: Given Visual basic code
Q: Rewrite the following if statements using the conditional operator:
A: Part(1) Following is the code using conditional operator: #include <iostream>…
Q: The Upper bound limit is 90, lower bound limit is -100. If a value is inputted (not through user but…
A: Give a testValue Below is the algorithm for above program 0. Start 1. if testValue is greater than…
Q: What will be printed after executing the following statement: Blank 1 cout << 30 % 4 * 5; Blank 1…
A: The given problem can be solved with the knowledge of operator precedence. Operator precedence means…
Q: QUESTION3. The program will ask the user to enter the width and length of a rectangle, and then…
A: Given:
Q: Write an application that allows a user to enter any number of student quiz scores, as integers,…
A: Introduction of the Program: This C++ program takes score from the user and if scores are between…
Q: PHP exercise 4 When you are writing scripts, you will often need to see exactly what is inside…
A: The given output in a PHP script can be achieved by using the var_dump() and print_r() methods and…
Q: The correct code for changing background color of form is Select one: a. Me.Color = Blue b.…
A: Css style to change background color
Q: Modify your working program from Assignment #19 so that when the user enters data into the Selling…
A: Description : Entry widgets are the basic widgets of Tkinter used to get input, for example text…
Q: Modify your working program from Assignment #19 so that when the user enters data into the Selling…
A: Note: Follow proper indentation to get output. Basic Methods used in Program: mainloop(): mainloop…
Q: ava Questions - (Has 2 Parts). Based on each code, which answer out of the choices "A,B,C,D,E" is…
A: Sol Part 1 - 7: DAY_OF_WEEK is an enum that represents the 7 days of the week. These days are…
Q: QUESTION3. The program will ask the user to enter the width and length of a rectangle, and then…
A: import java swing j option pane Create a class Rectangle with tow integer variable width and length…
Q: You can enter 1, 2, 3, or 4 for choosing an addition, subtraction, multiplication, or division test.…
A: Note: Here you didn't mention any programming language so we are solving this problem using the C++…
Q: Find the maximum value and minimum value in milesTracker. Assign the maximum value to maxMiles, and…
A: Given that We have to find the maxMiles and minMiles values for the given program. #include…
Q: Write an application that prompts the user for two integers and then prompts the user to enter an…
A: Here is the program screenshot in java:
Q: ComputeBMI.py, to let users enter their weight in pounds and their height in feet and inches. For…
A: PROGRAM CODE: # Prompt the user to enter weight in poundsweight = eval(input("Enter weight in…
Q: The following definition has errors. Locate as many as you can. A) void showValues(int nums) {for…
A: A) void showValues(int nums) {for (int count = 0; count < 8; count++) cout << nums[count];}…
Q: ered when the text box's contents cha
A: Required: It is triggered when the text box's contents change.
Q: In the following code snippet, where comments indicate line numbers: uint64_t x = 2; uint64_t y = 5;…
A:
Q: Evaluate the following expression: 6 / 2 * 3 + 4.
A: Given expression: 6 / 2 * 3 + 4 The rule for solving the expression is of the following order, {},…
Q: Find the value of ceil( floor(0.6) + ceil(0.4) )
A:
Q: CHALLENGE 1.6.4: Read user input numbers and perform a calculation. ACTIVITY Read two numbers from…
A: GIVEN:
Q: The variable which deviates the output at the setpoint level is known as
A: Error: The deviation of controlled variable from the setpoint is called error. Depending on the…
Q: add a code at the "Search a book" where i can search for a book and if the word matches the book it…
A: ALGORITHM:- 1. Declare and initialise an arrayList object for Book Titles. 2. Take input for the…
Q: The do-while statement below lets the user input an integer number multiple times as long as the…
A: Lets see the solution in the next steps
Q: Read your name and one numeric value [Omani Rial), print the following menu as shown in below…
A: As there is no programming language mentioned program is attempted in python user has to input name…
Q: Prompt for the user to enter their name. Print out their name forwards, backwards,…
A: Solution: Java code Main.java import java.util.Scanner; public class Main{ public static void…
Q: Select code that jumps to a label if an integer value in AL is negative. O test al,00000011b jnz…
A: Jump to label if integer value in AL is negative
Q: Create a simple game that will allow user to guess the secret number.
A: Note: As per the guidelines we are allowed to answer the only first question for multiple-type…
Q: A Moving to another question will save this response. estion 9 What is the output of the following…
A: Rem() function returns remainder when ➗ is performed between two numbers.
Q: Evaluate the following expression: ((8.0 / 2) * 8) + 10 % 6
A: Given ((8.0 / 2) * 8) + 10 % 6
Q: With multine text, you can do all of the following, except
A: We cannot insert an image.
Q: Write some simple code that can display a grade in a message box, given the marks through a textbox…
A: Code: Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles…
Q: Consider the following code to answer below questions: public double calculatePerimeter(Shapes []…
A: Principle of method is violated in line 1 because when you write the method with parameters it…
Q: Write some simple code that can display a grade in a message box, given the marks through a textbox…
A: ANSWER:-
Q: CHALLENGE 1.3.4: Read user input numbers and perform a calculation. АCTIVITY Read two numbers from…
A: Here we have statement to accept the 1st number from user. Now we need to use same statement to…
Q: The price of a plane ticket is 1000$ by default, but discounts are applied to it based on different…
A: If-else block is a part of the conditional statements.
Q: • getLength ()–This method should ask the user to enter the rectangle's length, and then return that…
A: The required Java code is: import java.util.Scanner;public class rectangle { double length;…
Q: How many times will the computer display the message box in the code below? intCounter = 0 Do…
A: In this question we have to find out from the looping program that the computer will display the…
Q: public boolean matchesYear(int y) – returns whether this game's year matches y public boolean…
A: Algorithm: Start Create a class Game with name, year and platforms as its attributes Implement…
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
- If the input is negative, make numItemsPointer be null. Otherwise, make numItemsPointer point to numItems and multiply the value to which numItemsPointer points by 10. Ex: If the user enters 99, the output should be:Items: 990 #include <iostream>using namespace std; int main() { int* numItemsPointer; int numItems; cin >> numItems; /* Your solution goes here */ if (numItemsPointer == nullptr) { cout << "Items is negative" << endl; } else { cout << "Items: " << *numItemsPointer << endl; } return 0;}It wont display the order total // JumpinJava.cpp - This program looks up and prints the names and prices of coffee orders. // Input: Interactive // Output: Name and price of coffee orders or error message if add-in is not found #include <iostream> #include <string> using namespace std; int main() { // Declare variables. string addIn; // Add-in ordered const int NUM_ITEMS = 5; // Named constant // Initialized array of add-ins string addIns[] = {"Cream", "Cinnamon", "Chocolate", "Amaretto", "Whiskey"}; // Initialized array of add-in prices double addInPrices[] = {.89, .25, .59, 1.50, 1.75}; bool foundIt = false; // Flag variable int x; // Loop control variable double orderTotal = 2.00; // All orders start with a 2.00 charge // Get user input cout << "Enter coffee add-in or XXX to quit: "; cin >> addIn; // Write the rest of the program here. while(addIn != "XXX") //loop until user…Using C++ Language If the input is negative, make numItemsPointer be null. Otherwise, make numItemsPointer point to numItems and multiply the value to which numItemsPointer points by 10. Ex: If the user enters 99, the output should be:Items: 990 Code: #include <iostream>using namespace std; int main() { int* numItemsPointer; int numItems; cin >> numItems; /* Your solution goes here */ if (numItemsPointer == nullptr) { cout << "Items is negative" << endl; } else { cout << "Items: " << *numItemsPointer << endl; } return 0;}
- Please written by computer source Write a program that reads the subtotal and the gratuity rate, then computes the gratuity and total. For example, if the user enters 10 for subtotal and 15% for gratuity rate, the program displays $1.5 as gratuity and $11.5 as total. Sample Run Enter the subtotal and a gratuity rate: 10 15 The gratuity is $1.5 and total is $11.5 Class Name: Exercise02_05#include <iostream> #include <string> #include <iomanip> using namespace std; void display(char ans); void display(int n); double calcPrice(double hour, int n) { double total; cout << "Total for " << hour << " hour(s): RM"; hour=hour/3; switch (n) { case 1: total=hour*6; cout << setprecision(4) << "" << total << endl; break; case 2: total=hour*5; cout << setprecision(4) << "" << total << endl; break; case 3: total=hour*7; cout << setprecision(4) << "" << total << endl; break; } return total; } struct Car { string car1; string car2; string car3; }; int main() { string name, ic, telNo; char ans, choice; int age, n; double hour; cout << "*** WELCOME TO CAR RENTAL SYSTEM ***" << endl << endl; Car types; types.car1 = "Sedan: Honda City, Honda Civic, Perodua Bezza"; types.car2 = "Hatchback: Perodua Axia, Proton Iriz, Perodua Myvi"; types.car3 = "SUV: Honda…#include <iostream> #include <string> #include <iomanip> using namespace std; void display(char ans); void display(int n); double calcPrice(double hour, int n) { double total; cout << "Total for " << hour << " hour(s): RM"; hour=hour/3; switch (n) { case 1: total=hour*6; cout << setprecision(4) << "" << total << endl; break; case 2: total=hour*5; cout << setprecision(4) << "" << total << endl; break; case 3: total=hour*7; cout << setprecision(4) << "" << total << endl; break; } return total; } struct Car { string car1; string car2; string car3; }; int main() { string name, ic, telNo; char ans, choice; int age, n; double hour; cout << "*** WELCOME TO CAR RENTAL SYSTEM ***" << endl << endl; Car types; types.car1 = "Sedan: Honda City, Honda Civic, Perodua Bezza"; types.car2 = "Hatchback: Perodua Axia, Proton Iriz, Perodua Myvi"; types.car3 = "SUV: Honda…
- This code prompts the user for input to create a Mad Lib,converts the Mad Lib to uppercase, finds the number of timesthe word 'a' appears in the Mad Lib, finds the unique words in the Mad Lib using sets, and checks if a specific word isin the Mad Lib using an if condition.'''import datetime # Get user inputname = input("Enter a name: ")adjective = input("Enter an adjective: ")verb1 = input("Enter a verb: ")verb2 = input("Enter another verb: ")noun1 = input("Enter a noun: ")noun2 = input("Enter another noun: ")animal = input("Enter an animal: ")food = input("Enter a food: ")fruit = input("Enter a fruit: ")superhero = input("Enter a superhero name: ")country = input("Enter a country name: ")dessert = input("Enter a dessert: ")year = datetime.datetime.now().year # Create a Mad Lib with the user inputmad_lib = f"{name} was a {adjective} person who loved to {verb1} and {verb2}. One day, {name} found a {animal} in their {noun1}. " \ f"They decided to take the {animal} to the {noun2}…Please rewrite the code: Here is the code: class PidManager {// Declare the range of possible pid valuesprivate static final int MIN_PID = 300;private static final int MAX_PID = 5000; // Declare a memory locationprivate static int[] pids; // Create a method named allocatMap().// This method is used to allocate the// memory to store the pids.public static int allocatMap() {pids = new int[MAX_PID - MIN_PID];if (pids == null) {System.out.println("Memory allocation failed.");return -1;} for (int i = 0; i < pids.length; i++) {pids[i] = 0;}System.out.println("Memory allocated successfully.");return 1;} // Create a method named allocatPID().// This method is used to allocates and returns a pid.public static int allocatPID() {if (pids == null) {System.out.println("PID Manager is not initialized ");return -1;} int pidNum = -1; for (int i = 0; i < pids.length; i++) {if (pids[i] == 0) {pids[i] = 1;pidNum = i + MIN_PID;break;}}if (pidNum == -1) {System.out.println("Unable to allocat…The program code is unable to execute fully. Please help fix it. #include <iostream>using namespace std; int best_fertilizer(int Yield_of_Fertilizer1, int Yield_of_Fertilizer2, string Fertilizer1, string Fertilizer2); int main(){ int Yield_of_Fertilizer1, Yield_of_Fertilizer2;string Fertilizer1, Fertilizer2;string result; cout<<"Enter first fertilizer name: ";cin>>Fertilizer1;cout<<"Enter second fertilizer name: ";cin>>Fertilizer2;cout<<"Enter the yield of first fertilizer value: ";cin>>Yield_of_Fertilizer1;cout<<"Enter the yield of second fertilizer value: ";cin>>Yield_of_Fertilizer2; result = best_fertilizer(Yield_of_Fertilizer1, Yield_of_Fertilizer2, Fertilizer1, Fertilizer2); cout<<"The fertilizer with the greatest yield: "<< result;return 0;}int best_fertilizer( int Yield_of_Fertilizer1,int Yield_of_Fertilizer2, string Fertilizer1, string Fertilizer2); if(Yield_of_Fertilizer1 > Yield_of_Fertilizer2) return…
- Based on coding below, help me fix all the error until the program can be run properly and neatly #include <iostream>#include <iomanip>#include <ctype.h>#include <string> using namespace std; struct nodeBankAccount{string bank_acc_name;string bank_acc_num;double bank_acc_bal; nodeBankAccount*link;}; nodeBankAccount *head, *rear;nodeBankAccount *current;nodeBankAccount *newNode;nodeBankAccount *deleteBank;nodeBankAccount *previous;nodeBankAccount *found; void addBankAccount(){char answer;int insertOption; do{newNode = new nodeBankAccount; cout << "Fill in the details below" << endl;cout << "Bank Account Name: ";cin>>newNode->bank_acc_name;cout << "Bank Account Number: ";cin>>newNode->bank_acc_num;cout << "Bank Account Balance: " << "RM ";cin>>newNode->bank_acc_bal;newNode->link = NULL; if(head == NULL){head = newNode;}else{cout<<"Press 1 to insert the new record at front of the…void removeStudent(){System.out.print("\n Enter StudentID to remove: ");long id =sc.nextLong();int pos = searchStudentID(id);if(pos == -1)System.out.println("\n ERROR: No student found having same ID: " + id);elsecourses.remove(pos);} int searchStudentID(long studentID){for(int c = 0; c < students.size(); c++)if(studentID == students.get(c).getId())return c;return -1;} The code is supposed to prompt the user to enter a studentID and if it is in the records then it will be removed, but instead it just prompts me to enter and when i enter the ID, it just exits and goes back to the menu. is there something wrong with my code?This code is correct but can you add to the code this instructions: If the father's age is equal to the mother's age and the age is odd, then the child is Female The code should call `createKidPerson` in main. #include <iostream>using namespace std; typedef struct { int age; char gender;} Person; void displayPerson(Person); Person createKidPerson(Person father, Person mother); int main(void) { Person father; Person mother; father.gender = 'M'; mother.gender = 'F'; //ask the user for the age of the Male Person and the age of the Female Person. cout<<"Enter the Male Person's age: "; cin>>father.age; cout<<"Enter the Female Person's age: "; cin>>mother.age; //create a new Person and call createKidPerson() function Person kid = createKidPerson(father, mother); displayPerson(kid); return 0;} Person createKidPerson(Person father, Person mother) { Person p; if(father.age>=mother.age) //if…