Declare a constant named YEAR, and initialize YEAR with the value 2050. Edit the statement myNewAge = myCurrentAge + (2050 − currentYear) so it uses the constant named YEAR. Edit the statement cout << "I will be " << myNewAge << " in 2050." << endl; so it uses the constant named YEAR. Execute the program by clicking the Run button at the bottom of the screen. Subject: Java Programming
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: A mobile phone service provider has three different subscription packages for its customers: Package…
A: Code: #include <iostream>using namespace std;int main(){ char choice; int mins, extramins;…
Q: Select from the options to fill in the blanks with a correct statement. Options may be used more…
A: The program creates a fork using fork(). Whenever pid > 0 the process is parent. When pid == 0…
Q: weight and the name of a planet. Use an enumerated type called planetType to represent the planets…
A: Actually, the code has given below:
Q: A particular talent competition has 5 judges, each of whom awards a score between 0 and 10 to each…
A: The complete code in python programming language is below:
Q: Pass the first parameter by reference and the second parameter by value. 1 char mein ( int c, char…
A: Given code: char mein(int c, char i) { c=50; i= (char) c; cout<< (int)c+i<<endl; return…
Q: Code 2.2 is for a program that demonstrates variable declarations and the use of literal and…
A: 1. What are the two symbolic constants used? 2. Show two methods of defining a symbolic constant…
Q: Create a VB.NET Console Application that does the following: Create a variable of Integer data type,…
A: ### CODE ### Module GradeConverter Sub Main() Dim marks As Integer Dim grade As…
Q: Question 1 Create a VB.NET Console Application that does the following: Create a variable of Integer…
A: Module VBModule Sub Main() Dim marks as integer' to declare marks as integer Dim grade as…
Q: 1)Write an application that displays the result of dividing two numbers and displays any remainder.…
A: Question given : Display result of dividing two number and reminder Source code: using System;class…
Q: 2. Create a program that computes and displays a game character's attack speed at a certain level.…
A: Given : To write a program to print the character current attack speed using the above formula. The…
Q: In which subprogram a RETURN statement does not return a value and so cannot contain an expression?…
A: The return statement is often written at the end of the program in order to make the compiler aware…
Q: Print either "Fruit", "Drink", or "Unknown" (followed by a newline) depending on the value of…
A: This is multiple type question, hence only first question has been answered. The question is to…
Q: Create a program is C# called MarshallsRevenue.
A: C# (C-Sharp) is a programming language developed by Microsoft that runs on the .NET Framework. C# is…
Q: A particular talent competition has 5 judges, each of whom awards a score between 0 and 10 to each…
A: Given: To write a program that uses these rules to calculate and display a contestant’s score. A…
Q: Java Programming Write an application that prompts the user for two integers and then prompts the…
A: 1.Take 2 numbers as input from user.2. we have to use switch for menu driven program.3. give option…
Q: Write a statement that assigns finalValue with the multiplication of userNum1 and userNum2. Ex: If…
A: Answer the above questions are as follows:
Q: I need help for Microsoft Visual C#, 7th edition, chapter 5 debugging exercise 5-2 // Program asks…
A: // Program asks user to enter a stock number // If the stock number is not 209, 312, or 414 the…
Q: Write an application named EnterUppercaseLetters that asks the user to type an uppercase letter from…
A: Here, Code instruction is given.
Q: Starting Out With Visual Basic 8th edition chapter 6 #1 made in visual studio 2017 Retail…
A: i have divided the steps for better understanding :- Program Plan: • Implement an application that…
Q: The following code intends to input a user’s first name, last name, and age.However, it has an…
A: Corrected Code: #include <iostream>#include <string.h>using namespace std; int main(){…
Q: Complete the flowgarithm/pseudo code for the following scenario and upload into drop box Program…
A: pseudo code is the steps required to solve a particular problem in informal language. It uses common…
Q: 4- What will be displayed when the following codeis executed? int number = 6; while (number > 0)…
A: When the following code will execute its output is infinite number of 3 3 3 3 3 3 3 3 3 3 3 3 3 3…
Q: Trainers at Tom's Athletic Club are encouraged to enroll new members. Write an application that…
A: Step 1 Algorithm Step 1 : Begin Step 2 : Declare an array of strings with size 25 and an array of…
Q: Assume that grade is a variable whose value is a letter grade-- any one of the following letters:…
A: Given: Assume that grade is a variable whose value is a letter grade-- any one of the following…
Q: a) A prime number is an integer greater than 1 that is evenly divisible by only 1 and itself. For…
A: """PrimeNumber application that prompts the user for a number and thendisplays a message indicating…
Q: QUESTION 1 a) Based on the requirement given below, prepare a flowchart for a program develop for…
A: A flowchart is defined as the unified modeling language diagram it describes the flow of events or…
Q: Code 2: Write a program that will prompt a user to enter a systolic blood pressure (SBP) and…
A: Below is the required program in C language. Program Approach: Including header files for the…
Q: Jane has opened a new fitness center with charges of 2500 per month so the cost to become a member…
A: Note : I have added the output screenshot. Also with total money made, the code prints members and…
Q: Complete the flowchart & then write pseudo-code while taking manual attendance in a class
A:
Q: You are required to draw flow chart and write a Pseudocode for the following problem statement.…
A: Pseudo code: 1) Take input all the five values: customer name, mobile model, visit date, total…
Q: A Paint Company has asked you to write an application that calculates the quantity and price of…
A: Required: C++ program to calculate the quantity and price of Paint required to a paint for…
Q: Assume that a variable age has been given an integer value. Assume further that the user has just…
A: CODE IN PYTHON: #taking age as input from the userage = input("Enter your age:")age…
Q: Create a VB.NET Console Application that does the following: Create a variable of Integer data…
A: Background:- base concept of if else if ladder is used here. First take input and check the range…
Q: One way to use the browser console to view the progression of the value of the totalPrice variable…
A: The question is to choose the correct option for the given question.
Q: Cashier 1.0 is a C++ program that displays on the screen "Sweet and minty Lollipops! How many would…
A:
Q: 10. This is a named storage location in the computer's memory. operator class…
A: As per our policy, "Since you have asked multiple questions, we will solve the first question for…
Q: Write an application that handles a student report card. The application shall save the marks of…
A: Solution C# PROGRAM using System; //computer science, maths, english //75 congratulationa, else…
Q: mplete the process_name() function that takes a single string parameter name. You can assume that…
A: 1- This assignment requires, to take the input as firstName and surname from the user. 2- One space…
Q: getPrice(durianClass, durian Weight) double price=0 durian Class A? F durian Class B? T price=weight…
A: We need to write a C++ program for the given scenario.
Q: 2. Write an application that will calculate the Cummulative Grade Point Average [CGPA] using While…
A: The code and the output has been given in step 2.
Q: Indicate two button variables that may be utilised when the MessageBox function is invoked.
A: To be determine: Indicate two button variables that may be utilised when the MessageBox function is…
Q: Question 2) Write a user defined function called AdvancedMenu that simulates a menu with options the…
A: For defining a function we have to look at the syntax of the function, and other syntax used in the…
Q: reate a VB.NET Console Application that does the following: Create a variable of Integer data type,…
A: Required: Create a VB.NET Console Application that does the following: Create a variable of…
Q: 1. Retail Price Calculator Write an application that accepts from the user the wholesale cost of an…
A: The code and the output are given below:
Q: + Multiple Conditional Statements EmployeeBonus2.py >- Terminal 1 # EmployeeBonus2.py This program…
A: Find out the mistake from the code.
Q: // A standard mortgage is paid monthly over 30 years. // This program is intended to display 360…
A: Answer: for(int i=0; i<30;i++)//this loop is for the year for(int i=0;j<12;j++) printf("the…
Q: Create a VB.NET Console Application that does the following: Create a variable of Integer data ...…
A: Any variable's data type determines the type of data it can store. Different amounts of RAM are…
Q: Write a program that calculates and displays a person's body mass index (BMI). The BMI is often used…
A: Below is the required C++ program: - Explanation: - Importing the header files and the namespace.…
Q: Summary 2 EmployeeBonus.py - This program calculates an emplo productivity bonus. 3 In this lab, you…
A: Decision making is needed to execute a code or block of statements only if a certain condition is…
- Declare a constant named YEAR, and initialize YEAR with the value 2050.
- Edit the statement myNewAge = myCurrentAge + (2050 − currentYear) so it uses the constant named YEAR.
- Edit the statement cout << "I will be " << myNewAge << " in 2050." << endl; so it uses the constant named YEAR.
- Execute the program by clicking the Run button at the bottom of the screen.
Subject: Java
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
- Dice_Game.cpp #include <iostream>#include "Die.h" using namespace std; // a struct for game variablesstruct GameState { int turn = 1; int score = 0; int score_this_turn = 0; bool turn_over = false; bool game_over = false; Die die;}; // declare functionsvoid display_rules();void play_game(GameState&);void take_turn(GameState&);void roll_die(GameState&);void hold_turn(GameState&); int main() { display_rules(); GameState game; play_game(game);} // define functionsvoid display_rules() { cout << "Dice Game Rules:\n" << "\n" << "* See how many turns it takes you to get to 20.\n" << "* Turn ends when you hold or roll a 1.\n" << "* If you roll a 1, you lose all points for the turn.\n" << "* If you hold, you save all points for the turn.\n\n";} void play_game(GameState& game) { while (!game.game_over) { take_turn(game); } cout << "Game…_______ reference modifier is used to define the reference variable.Dice_Game.cpp #include <iostream>#include "Die.h" using namespace std; // a struct for game variablesstruct GameState { int turn = 1; int score = 0; int score_this_turn = 0; bool turn_over = false; bool game_over = false; Die die;}; // declare functionsvoid display_rules();void play_game(GameState&);void take_turn(GameState&);void roll_die(GameState&);void hold_turn(GameState&); int main() { display_rules(); GameState game; play_game(game);} // define functionsvoid display_rules() { cout << "Dice Game Rules:\n" << "\n" << "* See how many turns it takes you to get to 20.\n" << "* Turn ends when you hold or roll a 1.\n" << "* If you roll a 1, you lose all points for the turn.\n" << "* If you hold, you save all points for the turn.\n\n";} void play_game(GameState& game) { while (!game.game_over) { take_turn(game); } cout << "Game…
- #include int days_in_month(int month,int is_leap){ int res=-1; switch(month){ case 1: res=31;break; case 2: if(is_leap) res=29; else res=28;break; case 3: res=31;break; case 4: res=30;break; case 5: res=31;break; case 6: res=30;break; case 7: res=31;break; case 8: res=31;break; case 9: res=30;break; case 10: res=31;break; case 11: res=30;break; case 12: res=31;break; } return res; } int main(){ int m,l; printf("Enter month: "); scanf("%d",&m); printf("Enter 1 for leap year 0 for non leap: "); scanf("%d",&l); int days=days_in_month(m,l); printf("Days %d",days); } Write in cLook at the following statement.enum Color { RED, ORANGE, GREEN, BLUE };A) What is the name of the data type declared by this statement?B) What are the enumerators for this type?C) Write a statement that defines a variable of this type and initializes it with a validvalue.write code that assigns 1 to isAMember if the value of memberID can be found in current Members, and that assigns 0 to isAMemeber otherwise. Use only k, current Memebers, nMembers and isAMember. In C programming language
- Employee=(ID, name, position, officeN, phoneN, age)// assume the name is unique.Committee =( title, meetingDate, startTime, endTime, location)// You may use <,>,=,!=between dates and times.Membership= ( ID, title, task) // task = ‘member ‘or ‘chair’ For every employee, list the ID, name and number of committees he/she is serving onas member or chair.Text-based adventure game: Pretend you are creating a text-based adventure game. At different points in the game, you want the user to select to fight, run, or hide from certain enemies. Modify the application below (week3.py) so that the selection variable is sent as an argument into the choice() function. The user should enter 1 to fight, 2 to run, or 3 to hide in the main(). The choice() function should print one of the three options. You will need to add an if statement in the choice() function to make the correct selection.#include <iostream> #include <string> using namespace std; int main() { // Declare and initialize variables. string employeeFirstName; string employeeLastName; double employeeSalary; int employeeRating; double employeeBonus; const double BONUS_1 = .25; const double BONUS_2 = .15; const double BONUS_3 = .10; const double NO_BONUS = 0.00; const int RATING_1 = 1; const int RATING_2 = 2; const int RATING_3 = 3; // This is the work done in the housekeeping() function // Get user input cout << "Enter employee's first name: "; cin >> employeeFirstName; cout << "Enter employee's last name: "; cin >> employeeLastName; cout << "Enter employee's yearly salary: "; cin >> employeeSalary; cout << "Enter employee's performance rating: "; cin >> employeeRating; // This is the work done in the detailLoop() function // Use switch statement to…
- Fill-in-the-Blank When used as parameters, _________ variables allow a function to access the parameter’s original argument.Write a statement to print the data members of InventoryTag. End with newline. Ex: if itemID is 314 and quantityRemaining is 500, print:Inventory ID: 314, Qty: 500 #include <iostream>using namespace std; struct InventoryTag { int itemID; int quantityRemaining;}; int main() { InventoryTag redSweater; cin >> redSweater.itemID; cin >> redSweater.quantityRemaining; /* Your solution goes here */ return 0;}이6 ticket_price Complete the following function according to its docstring description. 1 def ticket_price(age: int) -> float: """Return the ticket price for a person with age in years. Seniors 65 and over pay 4.75, kids 12 and under pay 4.25, and everyone else 4 pays 7.50. 6. Precondition: age > e 7 8. >>> ticket_price(7) 9. 4.25 10 >> ticket_price(21) 11 7.5 12 >>> ticket_price(101) 13 4.75 14 History Submit