ENGE ACTIVITY 4.4.6: If-else expression: Operator chaining. Write an expression that will print "in high school" if the value of user_grade is between 9 and 12 (inclusive). Sample output with input: 10
Q: Suppose goals is a variable of type int. Write an if-else statement that displays the word Wow if…
A: Given : Suppose goals is a variable of type int. Write an if-else statement that displays the word…
Q: Write an if-else statement for the following: If userTickets is less than 5, execute awardPoints =…
A: import java.util.*;public class Main{ public static void main(String[] args) {…
Q: 1. Write a program where 52 deck of cards are suffled and 4 unique cards are dealt to a player. A…
A: #include<iostream> #include<cstdlib> #include<string.h> using namespace std; int…
Q: CHALLENGE ACTIVITY 422784.2543518.qx3zqy? Jump to level 1 Write an if-else statement for the…
A: If user Tickets is less than 8, execute award Points = 1. Else, execute award Points = User Tickets.
Q: After following statements have executed, what will be appear on the output window int i=0, a=0;…
A: int i=0, a=0; while(i<10){ a=a+i*i; i=i+2;…
Q: 1. What is the output of the following code snippet? int num = 50; if (num > 50); { num = num 5; }…
A: The given C++ code, Initializes the value of "num" as 50. Using "if" condition, the condition…
Q: CHALLENGE 1.2.3: Read multiple user inputs. ACTIVITY Write two cin statements to get input values…
A: #include <iostream> using namespace std; int main(){ int birthMonth; int birthYear;…
Q: CHALLENGE ACTIVITY 422784.2543518.qx3zq7 Jump to level 1 Write an if-else statement for the…
A: The answer for the above question is given in the below steps.
Q: Write the output of the code given below? for ( int x=1; x <= 10; x++ );…
A: The solution is the output of the problem. NOTE: The output given below can only be produced only…
Q: Write a program that prompts for an integer (that a side length) and displays, using asterisks, a…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: 1. Rock-paper and scissors game Take the name of the user1 and user2 Ask "do you want to choose…
A: def start_game(): user1 = input('Enter name of user 1 : ') #taking user 1's name user2 =…
Q: In admissions to military high schools, the age of the candidate should be between 13 - 17…
A: Java is a programming language. It contains extensive libraries (package). It can be used to create…
Q: Task 2: Here, we will use the printf statement to display text in the terminal (like we did in the…
A: Approach: Include necessary standard input and output header files in the main function ,write a…
Q: CHALLENGE 2.1.3: Basic if-else. ACTIVITY 422784.2543518.qx3zqy7 Jump to level 1 Write an if-else…
A: The code implementation in Java is given below. Algorithm: Begin. Prompt the user to input the…
Q: Using Math.max and/or Math.min, write a class MaxOrMin, and make sure to use Math.max and Math.min…
A: As per our guidelines, we can solve the first three-part of the question.
Q: After following statements have executed, what will be appear on the output window int i=10, a=0;…
A: Please find the answer below :
Q: Write a program in which the Nibble Monster keeps asking for nibbles until the user enters 'Q' or…
A: NOTE : Since programming language is not mentioned. Therefore answering question in python language.…
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: Write c++ code that print summery of exam result and decide either student should have makeup class…
A: In step 2, you will get c++ code. The user is taking one input as class strength. The user also…
Q: Write an if-else statement for the following: If userTickets is less than 8, execute awardPoints =…
A: The main advantages of high-level languages are:- - human-friendly - machine-independent - easy to…
Q: a. You have arranged a party to celebrate 31 December 2020 and you have invited all your friends.…
A: rand() is used to generate random number rand() % 2 will give random 1 or 2 1 for head and 2 for…
Q: What is y after the following statement is executed? x = 1; y = (x > 0) ? 10 : -10; 10
A: Given statements :- x=1; y = (x > 0) ? 10 : -10; clearly understand that the above statements are…
Q: = int(input("Enter value for x:")) if x == -1 : print("Disagree") elif x == 0: print("Neutral")…
A: Please find the answer below
Q: Write an expression that will cause the following code to print "less than 18" if the value of…
A: In this Java code, we have to write the if condition for that print the desired output. we have to…
Q: de to show a dialog box which says “Wlcome to Deptartment of CSE, Leading Universit
A: I have given code to print statement in dialogBox.
Q: Write an application that determines whether a phrase entered by the user is a palindrome. A…
A: import java.util.*; class palindrome{ void palin(){System.out.print("Enter the string you want…
Q: rite a program for an airline company. that asks the user about his luggage weight. * if the luggage…
A: NOTE: SINCE THE LANGUAGE OF THE PROGRAM IS NOT MENTIONED, I HAVE USED PYTHON FOR THE SOLUTION.…
Q: What is the value of the following expression? 2+4.00, 2**4.0 a. (6.0, 16.0) b. (6.00, 16.00) c.…
A: Please find the answer to the above question below:
Q: Ask the user to enter a day of the week in 3 letters. * Respond with the meal plan for that day.…
A: PROGRAM: //Header file import java.util.Scanner; //Defining the class class WeeklyMeakPlan {…
Q: Duke Shirts sells Java t-shirts for $24.95 each, but discounts are possible for quantities as…
A: Java Code:- import java.util.*; public class Main { public static void main(String[] args)…
Q: Write a program that takes a decimal value between 1 and 10 and displays its equivalent Roman…
A: 1) take input from the user 2)use one class to check the input define as check class 3) And other…
Q: CHALLENGE ACTIVITY 422784.2543518.qx3zqy7 Jump to level 1 Write an if-else statement for the…
A: #include <iostream>using namespace std; int main(){ int awardPoints; int userTickets;…
Q: Based on what you learned about if-else and switch statements, could you implement the following…
A: Difference between if-else and switch if-else Based on the result of the expression in the if-else…
Q: t is the value of the postfix expression 6 3 2 4 + - *: A. Something between -15 and -100 B.…
A: Brackets are not implied by the given expression, but I've used them to show you how this expression…
Q: Develop a letter-guessing game in this assignment. Requirements: 1). When the game begins, generate…
A: The java code is given below:
Q: Write an if-else statement for the following: If userTickets is greater than 8, execute awardPoints…
A: Hey, thank you for your question. To solve this problem, we can add a small coding snippet of…
Q: 5-3) (Find the highest score) Write a program that prompts the user to enter the number of students…
A:
Q: 1. Write the java statement that assigns 1 to x if y is greater than 0 2. Suppose that score is a…
A: As you have asked multiple question we are answering first. If you want solution of any specific…
Q: 2-Fully explain the following code and draw all possible outputs. Please input a number between 5…
A: Given code: <!DOCTYPE html> <html> <body> <p>Please input a…
Q: Write a switch statement that checks nextChoice. If 0, print "Rock". If 1, print "Paper". If 2,…
A: the below code is the answer:-
Q: ming that integer variables A and B are present in your workspace, which condition would make this…
A: if <condition> disp('A is not divisible by B.') end condition is to check whether A is not…
Q: Write a program that computes how much a customer has to pay after purchasing two items. Make the…
A: Step 1 : Start Step 2 : Take user input for the price of Item 1 and item 2. Step 3 : Calculate the…
Q: Exercise 4 - Another Dice Game In this game, the player begins with a score of 1000. The player is…
A: The program is implemented in java using object oriented approach. We have a class HighAndLow. The…
Q: Consider a vending machine that offers the following options: [1] Get gum [2] Get chocolate [3]…
A: Objective: An application should be built considering the functionalities of a vending machine. It…
Q: : write a program with visual basic code to give the evaluation for different marks as follows.…
A: below is the code:
Q: Based on what you learned about if-else and switch statements, could you implement the following…
A: #include <stdio.h> int main() { int A; printf("enter a number :: ");…
Q: Q2) write a java code to calculate the average for 3 student (each student has 5 subjects) and…
A: The marks for the students are in the range 0 to 50, with 50 being the highest marks. The Java…
Q: Craps is a single player dice game, that proceeds as follows: 1. the player rolls 2 six-sided dice…
A: Code: The python program is given by import random #function to calculate the sum of 2…
Sample output with input: 10
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
For some reason whenever I try this code, it does not accept it when the input is 13. I have tried other ways such as:
user_grade >=9<=12
which gets the code to be correct except when the input is 13.
How do I get the code to say not in school when input is 13?
- 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…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 does not remove the ID (I display the data again after I supposedly removed it but it is still there) and just returns back to the menu. What can I do to correct it?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?
- Simple Student Management System Build the following app using Python Tkinter library. Using this app, user can • add student information • view all students • search student(s) by name • remove student by id Add • First name, last name, date of birth cannot be blank while adding a specific student information. • However major can be blank, which gets set to "Undefined" if left out blank. • Student Id is automatically generated by the program (ex: 1001, 1002, 1003, 1004 ….) If the user keeps a mandatory field blank (ex: First name) and presses "Add Student" button, it displays the following message box: first name is required If the user successfully enters all the necessary information and presses the "Add Student" button, it displays the following confirmation message box: student added View All When the user presses the "View All" button, it displays all the student’s information (Id, First name, Last name, Date of birth, and Major) in a nice formatted way. Example below: • Must…Given following code and write comments for those code #include <stdio.h>#include <stdbool.h>#include <string.h>#include <ctype.h> #define MAX_PASSWORD_LENGTH 128#define MIN_PASSWORD_LENGTH 10#define ALLOW_PASSPHRASE true#define MIN_PHRASE_LENGTH 20#define OPTIONAL_TESTS_REQUIRED true#define MIN_OPTIONAL_TESTS_TO_PASS 4 bool isStrongPassword(char *password);void printTestResults(char *password, bool isPassphrase, int optionalTestsPassed); int main() { char passwords[][128] = { "password", "mypassword", "thisismypassword", "passssword", "This is my password phrase1", "Tinypw1", "Ireallydontlikehavingtomakeupnewpasswordsallthetime1", "Iloveyouxxxooo1", "Boom**********!", "IHATEPWORDS1!", "ihatepwords1!", "IHatePwords!", "IHatePwords", "my pass phrase does not need to pass tests", "short pass phrase", "x", "x1", "Zxcvbnmnas7",…A(n) _____________ is generated when a user interacts with a GUI object. a. error b. occasion c. method d. event
- Challenge 2: InvalidNumbers.java Write a program InvalidNumbers that asks the user to enter a positive integer. The program will warn the user if a valid integer is not entered using the InputMismatchException and ask to enter again. The program should also throw an exception if the user enters negative numbers. Write the program and test it using negative numbers, doubles, and very large numbers.Fix the errors in the Customer class and the Program. #include <iostream>#include <fstream>#include <string>using namespace std; class Customer {// Constructorvoid Customer(string name, string address) : cust_name(name), cust_address(address){acct_number = this.getNextAcctNumber();} // Accessor to get the account numberconst int getAcctNumber() { return acct_number; } // Accessor to get the customer namestring getCustName(} const { return cust_name; } // Accessor to get the customer addressstring getCustAddress() const { return cust_address; } // Set a customer name and addressstatic void set(string name, string address); // Set a customer addressvoid setAddress(string cust_address) { cust_address = cust_address; } // Get the next account number for the next customer.static const unsigned long getNextAcctNumber() { ++nextAcctNum; } // input operatorfriend Customer operator>> (istream& ins, Customer cust); // output operatorfriend void operator<<…C++ CODERS!Please complete the lost password function and the sign in account function. Will rate, thank you! //Accounts class detail#include <iostream>using namespace std;#include <fstream> class Accounts{private:char first_Name[40];char last_Name[40];int std_id;int std_age;int std_major;int user_input;public://gathering info of studentvoid getStd(void);//display info o studentvoid display_std(void);void Title(void);void Menu(void);void new_Account(void);void sign_in_Account(void);void lost_password(void);};void Accounts::getStd(void) {cout<<"Enter the student information"<<endl;cout<<"Accounts name: ";cin>>first_Name;cout<<"Accounts ID: ";cin>>std_id;cout<<"Accounts Age: ";cin>>std_age;cout<<"Accounts Major: ";cin>>std_major;}void Accounts::display_std(void) {cout<<"The Accounts information"<<endl;cout<<"Name: "<<first_Name<<endl;cout<<"ID:…
- modifying following code and write comments for each line of codes. #include <stdio.h>#include <stdlib.h>#include <stdbool.h>#include <string.h> #define MAX_PASSWORD_LENGTH 128#define MIN_PASSWORD_LENGTH 10#define ALLOW_PASSPHRASE true#define MIN_PHRASE_LENGTH 20#define OPTIONAL_TESTS_REQUIRED true#define MIN_OPTIONAL_TESTS_TO_PASS 4 bool isStrongPassword(char *password);void printTestResults(char *password, bool isPassphrase, int optionalTestsPassed); int main() { char passwords[][128] = { "password", "mypassword", "thisismypassword", "passssword", "This is my password phrase1", "Tinypw1", "Ireallydontlikehavingtomakeupnewpasswordsallthetime1", "Iloveyouxxxooo1", "Boom**********!", "IHATEPWORDS1!", "ihatepwords1!", "IHatePwords!", "IHatePwords", "my pass phrase does not need to pass tests", "short pass phrase", "x", "x1",…struct Info { int id; float cost; }; Given the struct above, the following code segment will correctly declare and initialize an instance of that struct. Info myInfo = {10,4.99}; Group of answer choices True False ============== Consider the following code fragment. int a[] = {3, -5, 7, 12, 9}; int *ptr = a; *ptr = (*ptr) + 1; cout << *ptr; Group of answer choices 4 -5 3 Address of -5 =============== What will happen if I use new without delete? Group of answer choices The program will never compile The program will never run The program will run fine without memory leak None of theseI am recieving error "void cannot be dereferenced" and therefore "cannot envoke toString()" How would one fix this? System.out.println(mailbox.getMessage(0).toString());System.out.println(mailbox.getMessage(1).toString());