What will the following program segment display? const int UPPER = 8, LOWER = 2;int num1, num2, num3 = 12, num4 = 3; num1 = num3 < num4 ? UPPER : LOWER;num2 = num4 > UPPER ? num3 : LOWER; cout << num1 << " " << num2 << end1;
Q: You have been hired as an app developer for the company. The company plans to make an app for a…
A: Iterate over given list of order_items If item present in map, add its price to total Finally add…
Q: (3) Write another function named ReadGroceryList that reads the information from grocery.txt and…
A: We have to add the function ReadGroceryList Function will take file name as the input and will call…
Q: Assume that you have a data structure of the following: A list of hockey players. Each hockey…
A: Hockey is a list of list data structure, it is passed to the function and then in the least_assists…
Q: nt fact(int x); BIUS AV Slides Drawing Editi Aa AA %3D roid main() Font Paragraph int result;…
A: According to the Question below the Solution: Output:
Q: QUESTION 1 Write a program that can request the size of pizza, quantity from the user and calculate…
A: Code: #include <stdio.h>int main(){ //declaring required variables int price; int…
Q: Fix it please #include using namespace std; int main()
A: include<iostream>using namespace std;int main(){char item1[20]="Fresh Milk",…
Q: #include using namespace std; int main() { int i, j, space; space = 5-1; for(i=1;…
A: A flow chart helps the team to involve and understand the process in its current . This is often…
Q: // Add to this partially built code. // fill in code where there is a TODO…
A: Add data type char for variables destination and typeOfDay. Define bool variable isDayTime and…
Q: Assume a program has the following variable definitions:a = b = 3c = 5.2 and the following…
A: Answer :
Q: consider the following code * #include using namespace std; int main() { double wages, hours,…
A: If the working hours is between 1 to 40 then, totalWages = (rate * hours) If the working hours is…
Q: Write a C# console application named TotalCharge that asks the user to enter 5 positive integers,…
A: using System; class Program { static void Main(string[] args) { double []arr = new…
Q: _classic()+ theme(legend.title = element_text(size = 12), legend.text = element_text(size = 10) ) +…
A: R Programming: create a function on your own out of this code for a ggplot. ggplot(pr.cb.fulldata,…
Q: 6.15 LAB: JavaScript password strength Write a function called isStrongPassword() in script.js that…
A: NOTE: - The script.js and PasswordCheck.html are placed in the same folder. Open the html file with…
Q: // Program 4.8.1 #include #include using namespace std; int main () { char str1[10] = "Hello";…
A: The following program: 1. Copies string 2. Concatenates string 3. Finds out string length 4. Inserts…
Q: At the interactive prompt define a list named L that contains four strings or…
A: Index out of bounds exception is defined as the error that causes it there is a buffer overflow like…
Q: // Add to this partially built code. // fill in code where there is a TODO…
A: Add data type char for variables destination and typeOfDay. Define bool variable isDayTime and…
Q: In C++, using any STL algorithms, iterators, or containers show all items from movies.txt.…
A: Solution: The STL(Standard Template Library) is a set of C++ template class to give common data…
Q: Please Write a function to validate an email
A: According to question we write email validation in java.…
Q: Function 3: Positive Unique Numbers _missingSpace (string) Create a JavaScript Arrow function that…
A: Answer : Text format of code for the JavaScript file script.js to copy: const _missingSpace =…
Q: #include using namespace std; int main() { char ch; cout>choice; cout>ch; cout>ch; cout>ch;…
A: Code //This program is For Freddy's Pizza#include <iostream>using namespace std;int main(){…
Q: Please provide proper comments. Define the following code. #include 2 #include 3 4 #define…
A: This is the C language code which is playing some songs and calculating their playing time in…
Q: You have been hired as an app developer for the company. The company plans to make an app for a…
A: According to the Question below the Solution: Program Output:
Q: QUESTION 1 Write a program that can request the size of pizza, quantity from the user and calculate…
A: In C, the if-else statement is used to carry out operations based on a set of conditions. If and…
Q: You have been hired as an app developer for the company. The company plans to make an app for a…
A: In python list is a data structure that is used for storing multiple data values in a single…
Q: Write a complete C++ program that implements the Breadth First Search (BFS)Algorithm (Chapter 22).…
A: 63 answers #include<bits/stdc++.h> using namespace std; //function for bfs traversal void…
Q: hi can you please write this code function avg(){ vara = parseInt(prompt("Enter 1st number"))…
A: <!DOCTYPE html><html><head> <title> Average of four numbers </title>…
Q: Create a function print_double_spaced(cs) that takes a C string as an argument and prints the…
A: Answer :
Q: The international standard letter/number mapping for telephones is shown below. DEF 123 ABC GHI JKL…
A: In step 2, you will get C++ code. In step 3, you can see the sample output.
Q: Create a VB.NET Console Application that does the following; variable of Integer data type (marks)…
A: Given: Create a VB.NET Console Application that does the following; variable of Integer data type…
Q: What will be displayed on the console when j = 2 in the following code segment? You can give an…
A: Given a code snippet: cout<<"Value of j = "<<j<<endl; for(int…
Q: Programming Language: C++ I need the codes for extRomanType.cpp, extRomanType.h, main.cpp,…
A: #include <iostream> #include <string> #include "roman.h" using namespace std; void…
Q: How do you insert a function within a three js program in the html file to return a mesh…
A: The following can be used as a reference. :)
Q: Write a program that first gets a list of 5 integers from input. Then, get another value from the…
A: Coral is an ultra-simple language for learning programming. Key features: Simplicity: Coral only…
Q: pseudocode
A: Given :- In the above question, the statement along with the given pseudo code is mention in the…
Q: Given the following local variable declarations: string s1 = "Welcome to C++ World"; string…
A: Here first we declare variable string s1 = "Welcome to C++ World" string s2, s3; s1 contains…
Q: complete magic Square #include using namespace std; /*int f( int x, int y, int* p, int* q ) { if…
A: It is defined as a direct descendant of C programming language with additional features such as type…
Q: Hello. I need help changing the C++ code so that the highlighted portions are can be entered by the…
A: #include <iostream> #include <iomanip> #define swap(v1, v2, temp) temp = v1, v1 = v2, v2…
Q: onsole application to print alphabets from a to z.
A: Given: Create a VB.NET Console application to print alphabets from a to z.
Q: Write a C# .NET Core Console App that asks the user to enter a number and then displays a string…
A: using System; namespace ReverseNo { class Program { static void Main(string[]…
Q: What will the following program display? #include <iostream> #include <string> #include…
A: Here, one C++ program is given. We have to give the output of the program. Program: #include…
Q: Create a function, named "myplotfunc" that takes the following positional arguments as inputs: • A…
A: import matplotlib.pyplot as pltimport math %matplotlib inline#function to plot a linedef…
Q: Create a JavaScript Arrow function that meets the following requirements: _missingSpace(string) •…
A: Introduction Create a JavaScript Arrow function that meets the following requirements:…
Q: This challenge is based on the classic videogame "Snake". Assume the game screen is an n * n square,…
A: In this question we need to write a program to calculate how many times a snake can eat before…
Q: This challenge is based on the classic videogame "Snake". Assume the game screen is an n * n square,…
A: Step-1: Start Step-2: function snakefill(n) Step-2.1: Declare variables sum=1, i Step-2.2: Start a…
Q: lease Write a function to validate if the numbers were 1 through 9 if there is a name if email…
A: The program is written in HTML and Javascript. Please find the validation and output in the below…
Q: 9. Write a function maximum that finds, for a pair of integers, the maximum value between the two…
A: In this HTML JAVASCRIPT User Interacted Page Function To find Maximum Integer from a two pair set…
Q: Download shapes.h and renderer3.cpp from Canvas. (a) Complete the interative portion of the renderer…
A:
Q: // Fix this program that works // Use welcome function that display the message in diffreent color…
A: Program Plan:- 1. Add the two functions welcome () and table(). 2. The table function will display…
Q: std; const int ROWS = 3; const int COLS = 3; const int MIN = 1; const int MAX = 9; bool…
A: It is defined as a graphical representation of steps. It shows steps in sequential order and is…
Q: Create a JavaScript Arrow function that meets the following requirements: • Authored using arrow…
A: Yes, this one line code will do the job. Basically we are just using the replaceAll method of…
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.
What will the following
const int UPPER = 8, LOWER = 2;
int num1, num2, num3 = 12, num4 = 3;
num1 = num3 < num4 ? UPPER : LOWER;
num2 = num4 > UPPER ? num3 : LOWER;
cout << num1 << " " << num2 << end1;
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Please Write a function to validate if the numbers were 1 through 9 if there is a name if email is valid if cell phone i valid if Card number, EXP date and CVV is valid or not if the address is valid or not Below is the html please make the java code as simple as posible thank you. <div class="g"> <div class="n"> <div class="r"> <img class="a"src="stle/pg1/logo.png"> <div class="p">+</div> <form id="result" action="#"> <input type="text" placeholder="Choose from item 1-9"> <input type="text" placeholder="Name"> <input type="email" placeholder="E-mail@gmial.com" id="email"> <input id="Phone nuber" type="text" placeholder="Phone number"> <input id="Card Number" type="text" placeholder="Card Number"> <input id="Card Exp Date" type="text" placeholder="Card Exp Date"> <input id="Card CVV" type="text"…Using DevC++, create a program to solve for Oblique Triangles (Case 1 - Case 4) Create a Menu Driven Program Solutions of Oblique Triangle:Case 1: Given two angles and one sideCase 2: Given two sides and an angle opposite one of themCase 3: Given two sides and their included angleCase 4: Given three sides The following structures must be evident: conditional looping programmer-defined functions arrayYou are developing a Fraction structure for Teacher’s Pet Software. The structure contains three public data fields for whole number, numerator, and denominator. Using the same structure, write the functions described below: • An enterFractionValue()function that declares a local Fraction object and prompts the user to enter values for the Fraction. Do not allow the user to enter a value of 0 for the denominator of any Fraction; continue to prompt the user for a denominator value until a valid one is entered. The function returns a data-filled Fraction object to the calling function. • A reduceFraction()function that accepts a Fraction object and reduces it to proper form, returning the reduced Fraction. For example, a Fraction entering the function as 0 2/6 would be reduced to 0 1/3, and a Fraction entered as 4 18/4 would be reduced to 8 1/2. • A displayFraction()function that displays any Fraction object passed to it. This function displays a fraction with a slash between the…
- 1. Write a function named drawPolygon that takes three input parameters, turtle t, integer numSides, and integer sideLength and it draws the corresponding polygon using turtle graphics. Hint – for a regular polygon with n sides, the exterior angle is 360/n.2. Call function drawPolygon to draw an equilateral triangle with side length 100, a square with length 150 and a regular pentagon with side length 175. 3. Write code that uses the Python math module to compute and print out the values ofa. 100!b. the log (base 2) of 1,000,000c. the greatest common divisor of 63 and 49what is each line of the code below do? #include "mbed.h"#include "Servo.h"#include "Map.hpp" 1. AnalogIn JoystickPin1(A0);2. AnalogIn JoystickPin2(A1); 3. Servo ServoMotor1(D3);4. //Servo ServoMotor2(D4); 5. Map AnalogPos(0,1023,0,180); 6. int main(){7.float Position1,Position2; 7. while (true) { 8. Position1=AnalogPos.Calculate(JoystickPin1.read());9. Position2=AnalogPos.Calculate(JoystickPin2.read()); 10.ServoMotor1.position(Position1); 11. printf("JoyStick1");12. printf("%f",Position1); 13. printf("JoyStick2"); 14. printf("%f",Position2); 15. ServoMotor1.position(Position1);}}A student has established the following monthly budget:Housing 500.00Utilities 150.00Household expenses 65.00Tran sporta tion 50.00Food 250.00Medical 30.00Insurance 100.00Entertainment 150.00Clothing 75.00Miscellaneous 50.00Write a modular program that declares a Monthl yBudget structure with membervariables to hold each of these expense categor ies. The program should create twoMonthl yBudget structure variab les. The first will hold the budget figures given above.The second will hold the user-enter amoun ts actually spent during the past month.Using Program 7-19 as a model, the program should create a screen form that displayseach category name and its budgeted amoun t, then positions the cursor next to it forthe user to enter the amount actually spent in that category. Once the user data has allbeen entered, the program should compute and display the amoun t over or underbudget the student's expend itur es were in each category, as well as the amount over orunder budget for the…
- Assignment Name JavaScript Concepts III Assignment Filename lastname-circleArea.html (replace lastname with your last name). area.js Assignment Description This assignment demonstrates the following concepts: JavaScript Functions Assignment Instructions Write a JavaScript program that calculates the area of a circle: Write a function that calculates the area of a circle given the radius. Formula: Math.PI * (radius * radius) Your program code should contain appropriately named variables. Use documentation to identify various components of your program. Call the function once and pass a radius value of 10.75 to it. Use the starter files and complete the logic to satisfy the instructions. To access the files, download and save the circleArea.zip folder attached to this assignment. Then unzip the compressed folder to reveal the included files: circleArea.html and area.js. Be sure that the two files are in the same folder. Then write your code in the area.js…Rock, Paper, Scissors Game Create a application using (C#) in Microsoft Visual Studio that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows.1. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Do not display the computer’s choice yet.)2. The user selects his or her choice of rock, paper, or scissors. To get this input you use clickable PictureBox controls displaying some of the artwork that you will find in the student sample files.3. The computer’s choice is displayed.4. A winner is selected according to the following rules: •If one player chooses rock and the other player chooses scissors, then rock wins. (Rock smashes scissors.)•If one player chooses scissors and the other player chooses paper, then scissors wins.…Consider the following code. Answer questions 1 to 4. This is a walkthrough question #include <iostream> #include <cstring> using namespace std; const int NT = 10; const int NC = 2; class Chocolate { char type[NT + 1]; public: Chocolate(const char* t = nullptr) { if (t) { strncpy(type, t, NT); type[NT] = '\0'; } else { type[0] = '\0'; } cout << "C"; } ~Chocolate() { cout << "~" << type << endl; } void display() const { cout << type << endl; } }; class Box { Chocolate ch[NC]; int nc; public: Box() { nc = 0; cout << "B"; } Box& operator+=(const Chocolate& c) { if (nc < NC) { ch[nc] = c; cout << "+"; ch[nc++].display(); } return *this; } Box(const Box& b) { nc = b.nc; for (int i = 0; i <…
- struct date{ int day; int month; int year; }; Write a function named void increaseDay(struct date *d) that increases the value of a variable of struct date type with integer year, month, and day members by one day. Write a function named void decreaseDay(struct date *d) that decreases the value of a variable of struct date type with integer year, month, and day members by one day. Write a C program that reads from the user a date in d/m/y format and the amount of increase or decrease as an integer. Display the new date in d/m/y format. You may call related functions as many as given increase or decrease value. Note 1: You do not need to consider leap years. Use always 28 days for month February. Note 2: Do not modify the function prototypes. Sample Input1: Sample Output1: 12/8/1990 -5 7/8/1990 Sample Input2: Sample Output2: 26/2/2005 5 3/3/2005 Sample Input3: Sample Output3: 29/12/1998 7 5/1/1999…Please Write a function to validate if the numbers were 1 through 9 if there is a name if email is valid if cell phone i valid if Card number, EXP date and CVV is valid or not if the address is valid or not Below is the html please make the java code as simple as posible as if it was for beginers please. also when ever its false can you make the text print on the bottem for example look at the picture <div class="g"> <div class="n"> <div class="r"> <img class="a" src="#"> <div class="p">+</div> <form id="result" action="#"> <input type="text" id="number" placeholder="Choose from item 1-9"> <input type="text" id="name" placeholder="Name"> <input type="email" emailplaceholder="E-mail@gmial.com" id="email"> <input id="Phonenumber" type="text" placeholder="Phone number">…6. Below is an application in which the number of days for each month in the year is stored in anarray. (For example, January has 31 days, February has 28, and so on. Assume that the year is not aleap year.) Display 12 sentences in the same format for each month; for example, the sentencedisplayed for January should be: Month 1 has 31 days. Given the following pseudocode, fill in themissing lines of code start//Declarationsnum monthnum SIZE = 12num DAYS finish declaring and populating arraymonth = 0while month < SIZEoutput complete output statementmonth = ____________endwhilereturnstop