choose the suitable choice for ternary condition such that x-4 #include using namespace std; int main () int a=4, b39,x;, //Type the ternary condition here. cout<<"x="<0)?(a==4?b:a):(a<9?a:b); O x-(a>0)?(a>4?a:b):(a<9?a:b); O x=(al=b)?(a<50?a:b):(a>20?a:b); O x-(al=b)?(a>4?a:b):(a>4?a:b); O
Q: 1. Start with analysing the problem by using a flowchart/pseudo code. 2. As mention above, build a…
A: #include<conio.h> #include<iostream> #include<fstream> #include<Windows.h>…
Q: You are about to enter a place with calculating addition of three numbers. You need to complete the…
A: #include <iostream> using namespace std; class class_1 //declare a class {protected:…
Q: 1. Start with analysing the problem by using a flowchart/pseudo code. 2. As mention above, build a…
A: #include <iostream.h> #include <conio.h> #include <string.h> #include…
Q: S(x, n)= X/2! -(X')/4! + (XV6!-(X'V8! + (X2n-1)/2n!. Define the functio pwr(x.y) to compute x terms…
A: For the given problem, we need to compute : S(x,n) = (X/2!) - (X3/4!) + (X5/6!) - ............. +…
Q: 1. Start with analysing the problem by using a flowchart/pseudo code. 2. As mention above, build a…
A: The answer for the above question is as follows
Q: Use switch-case statements for this program. Write a menu-driven c program which has the following…
A: Switch Statement is a multiple is a multiple choice selection statement. It will be executed…
Q: a C++ function, reverseDigit, that takes four digit integer as a parameter and returns the number…
A: The following points are important to write a function reverseDigit, which takes four digit integer…
Q: Write C++ program that accepts coefficients of a quadratic equation from the user and displays the…
A: #include <iostream>#include <cmath>using namespace std;int main() { float a, b, c,…
Q: Q3\ if 0001 = Load AC from memory, 0010 Store AC to memory, 0101= Add to AC from memory Where we…
A:
Q: The output printed after executing the following C++ code is Blank 1. int ex=95, ct ; switch (ex %…
A: Switch is a branching statement that takes expression and alters control to matching case.
Q: this is a C++ programs and convert the program into a complete assembly program using MIPS.…
A: Converting following c ++ code into assembly language
Q: Mr. Abu Tawfiq has a farm in Jordan Valley. His farm contains cows and chickens. In his farm, cows…
A: #include <iostream> #include <vector> using namespace std; float cow[100]={0}; int…
Q: bläi 6 Rewrite the code segment bellow by using switch statement instead of if- .else statement If…
A: PROGRAM CODE: #include <iostream> // include header file for input output stream…
Q: Write a program in C++ Jordan University of science and Technology has the following rules for…
A: #include <iostream>//header fileusing namespace std;int main() {//main method int n,m;…
Q: In C++, if the statement ( int a-5, b=2: ) is written at the beginning of the program, then the…
A: I HAVE PROVIDED THE ANSWERS FOR ALL 10 QUESTION 1.ElectricalEng2.4.53.char h='all';4.unsigned5.5…
Q: 17. Consider the following "C" code segment. At least how many test cases are needed for achieving…
A: Each branch of every possible decision point has to be executed at least once. So let's find the…
Q: C++ PROBLEM. PASTE INDENTED CODE HERE void e(int x, int y) { if(y<2) { cout << x << " "; return; }…
A: PROGRAM CODE: #include <iostream> using namespace std;void e(int x, int y) {if(y<2) {cout…
Q: his is a C++ programs and convert the program into a complete assembly program using MIPS. The…
A: Converting Above c++ code into MIPS
Q: Write a complete C++ program that can accept the name, quiz1, quiz2, assignment, test and final exam…
A: #include<bits/stdc++.h> using namespace std; int main(){ int quiz1[10]; int quiz2[10]; int…
Q: Consider the following code segment. It is designed to convert letter grades to grade points.…
A: There is Nothing Wrong with this code segment. Option 2,3 ,4 are False.
Q: Write a C++ function with the following signature: int boundSum() that requests an integer using…
A: - We have to complete the bound sum problem.
Q: B) R1= 20, R2-40 resistors are connected in series and R3-120, R4-40 resistors are connected in…
A: Here, we have given a Circuit Diagram , with 4 resistances R1 , R2 , R3 , R4 and Voltage V. We have…
Q: "use strict"; /* Question 04 Write a function which creates and returns a promise. Its job will…
A: Answer: I have done code and also I have attached code as well as code screenshot.
Q: B) RI= 20, R2=40 resistors are connected in series and R3=120, R4=40 resistors are connected in…
A: Voltage is the pressure from an electrical circuit's power source that pushes charged electrons…
Q: B) R1= 20, R2=40 resistors are connected in series and R3=120, R4=40 resistors are connected in…
A: the answer to above question:
Q: Problem4: Assume two banks want to establish a secure communication channel so that they can share…
A: Python used to answer this question
Q: 1. Start with analysing the problem by using a flowchart/pseudo code. 2. As mention above, build a…
A: The answer for the above question is as follows
Q: Mr. Abu Tawfiq has a farm in Jordan Valley. His farm contains cows and chickens. In his farm, cows…
A: C++ Code for the given problem in next step :-
Q: mmend/change the Following C programming code according to requirement :- Requirement :- I want to…
A: It is defined as a general-purpose, high-level language that was originally developed by Dennis M.…
Q: hich of the following i A. It is similar to the PL B. The RETURN clause C. Can be invoked only D The…
A: The PL/SQL operate is extremely just like PL/SQL Procedure. the most distinction between procedure…
Q: Write a C++ function with the following signature: int boundSum() that requests an integer using…
A: Here is the c++ code: See below step for code.
Q: 1. Start with analysing the problem by using a flowchartipseudo code. 2. As mention above, buikd a…
A: The program for the above question is as follows:
Q: Problem 4 Implement a small C program for the Omani Tesla cars customers. The program will be based…
A: Algorithm: Start Display the given menu to the user Ask the user to choose the tesla model Based on…
Q: Mr. Abu Tawfiq has a farm in Jordan Valley. His farm contains cows and chickens. In his farm, cows…
A: Programming is instructing a computer to do something for you with the help of a programming…
Q: i₁(x) == fv₁ (x) dx Write a C program that calculates the area under a curve for the function: v₁(x)…
A: // Used for input & output functions #include <stdio.h> // Used for math functions…
Q: Q # 4. Illustrate your knowledge of C-Programming by implementing a 'Game of Dice'. User will start…
A: PROGRAM CODE: #include <stdio.h>#include <stdlib.h>int menu();int roll_a_dice(); int…
Q: Assume a function F1 is defined with the heading: void F1(int a, double &b, double t]); Assume the…
A: Lets see the solution.
Q: Q1: Write a C# program that finds the value of Y from the following series: x5 x7 x2n+1 Y= x³ + + 2!…
A: The correct answer for the above mentioned question is given in the following steps for your…
Q: A departmental store request to you to automate their cash counter. According to his requirements,…
A: Read the amount that need to paid and then the amount that is given to the cashier. Then subtract…
Q: Write a complete C++ program consisting of the main function and a void function. The program uses…
A: The program will be finding two different programs using choice made by the user. We have used…
Q: Assume the following JavaScript program was interpreted using static-scoping rules. What value of x…
A: The answer is given in the below step
Q: In C++ Language, a)find the output (explain how) #include int f(int &x, int c) { c = c -…
A: Note: We are authorized to answer one question at a time since you have not mentioned which question…
Q: Consider the following JavaScript program: [5 marks] var a, b, x; function sub1() { var x, c, d;…
A: Given following sequence of dynamic scoping following sequence of callsmain calls sub2 and sub2…
Q: Mr. Abu Tawfiq has a farm in Jordan Valley. His farm contains cows and chickens. In his farm, cows…
A: #include <iostream>using namespace std; // Class for storing chcken(egg) dataclass…
Q: 3. The ABC Lumber Co. asks you to write a Phyton program that would produce a table of g properties…
A: Program description: base is the list that stores the base sizes of lumber. height is the list that…
Q: Q3: Write a complete C++ program that contains the integer functions (main, funx and funy). The main…
A: Given: Program is based on recursive function Funx(int n) is a function which returns value 1 if…
Q: 1- Which of the following is considered a keyword in C++ LANGUAGE? A) For B) Long C) Cin D) All of…
A: In the c++ language , a key word is something which has already meaning associated in the language.…
Q: Use DEV-C++ to develop a well-documented C++ program that: 1) Prompts the user to enter from the…
A: Code: #include <iostream>using namespace std;int main() { int n; //Iterating through the…
Q: The topic is Booth's algorithm - Explain this C programming code - i have a seminar. //header files…
A: Booth's Multiplication Algorithm: Booth’s algorithm is a multiplication set of rules that multiplies…
Q: 1, Build a C++ program based on the appropriate m. your own menu and display. onsider the following…
A: #include <bits/stdc++.h>#include <iostream>using namespace std; // defining a node for…
Step by step
Solved in 6 steps with 4 images
- //in c# // I am having problem with my regex fitting the requirments using System;using System.Text.RegularExpressions; namespace UsernameProcessor.Question{ public sealed class UsernameProcessorService{ /// <summary> /// Requirements: /// - A valid username shall be at least 4 characters. /// - A valid username shall contain only letters, numbers and an optional underscore. /// - A valid username shall start with a letter, and shall not end with an underscore. /// </summary> /// <param name="username"></param> /// <returns>Whether or not the username is valid per the above requirements.</returns> private static Regex sUserNameAllowedRegEx = new Regex(@"^(?=[a-zA-Z])[-\w.]{0,23}([a-zA-Z\d])$", RegexOptions.Compiled); private static Regex sUserNameIllegalEndingRegEx = new Regex(@"(\-_)$", RegexOptions.Compiled); public static bool IsValidUsername(string username) { if (string.IsNullOrEmpty(username) ||…The file DebugFour3.cs has syntax and/or logical errors. Determine the problem(s), and fix the program. I asked this once but ithe answer I was given was incorrect. // Program decides tuition based on several criteria: // 1 - 12 credit hours @ $150 per credit hour // 13 - 18 credit hours, flat fee $1900 // over 18 hours, $1900 plus $100 per credit hour over 18 // If year in school is 4, there is a 15% discount using System; using static System.Console; using System.Globalization; class DebugFour3 { static void Main() { int credits; year; string inputString; double tuition; const int LOWCREDITS = 12; const int HIGHCREDITS = 18; const double HOURFEE = 15000; const double DISCOUNT = 0.15; const double FLAT = 1900.00; const double RATE = 100.00; const int SENIORYEAR = 4; WriteLine("How many credits? "); inputString = ReadLine(); credits = Convert.ToInt32(inputString); WriteLine("Year in school? ");…Each function should accept two integer parameters indicating the minimum and maximum X value to be plotted. The functions should have no return values. Create class-level constants for things we might wish to change later, e.g., a char called PLOT_CHAR that holds an “x” (per samples below), another char called FILL_CHAR that holds an unobtrusive character like ASCII 183, generated with a cast, e.g., (char)183. JAVA PLEASE THOSE ARE NOT PERIODS OR DOTS. USE (System.out.print((Char)183); for (.) Please DON'T USE Loops(while);, if, Arrays, lists, or other data structures, objects, libraries, or methods. Sideways Ploty = 20sin(.5x)+20 where -11<=x<=11 ··································x ·······································x ·······································x ···································x ···························x ·················x········x·xx···x··········x····················x ·····························x ····································x…
- C++ please Redo so that all the named constants are defined in a namespace royaltyRates. A new author is in the process of negotiating a contract for a new romance novel. The publisher is offering three options. In the first option, the author is paid $5,000 upon delivery of the final manuscript and $20,000 when the novel is published. In the second option, the author is paid 12.5% of the net price of the novel for each copy of the novel sold. In the third option, the author is paid 10% of the net price for the first 4,000 copies sold, and 14% of the net price for the copies sold over 4,000. The author has some idea about the number of copies that will be sold and would like to have an estimate of the royalties generated under each option. Write a program that prompts the author to enter the net price of each copy of the novel and the estimated number of copies that will be sold. The program then outputs the royalties under each option and the best option the author could choose. (Use…Change value of isMomHappy to true and run the code. Provide your source code and the output var isMomHappy = false; //promise var willIGetNewPhone = new Promise( function (resolve, reject) { if(isMomHappy){ var phone = { brand: 'samsung', color:'black' }; resolve(phone); } else { var reason = new Error('mom is not happy'); reject(reason); } } ); //call our promise var askMom = function() { willIGetNewPhone .then(function (fulfilled){ //yay, you got a new phone console.log(fulfilled); //output: {brand: 'sumsung', color: 'black' } }) .catch(function (error) { //oops, mom didnt buy it console.log(error.message); //output: 'mom is not happy' }); }; askMom();Answer the questions or complete the tasks outlined in bold below, use the specific method described if applicable. Write a function that will get the email website domain from astring in the form: mon@mapua.edu.com For example, passing "mon@mapua.edu.com" would return: domain.com #write your code here: getDomain('mon@mapua.edu.com') #Output:'mapua.edu.com' You drive fast along EDSA, and an officer stops you. Write a function to return one of 3 possible results: "No credential," "Small credential," or "Big credential." If your acceleration is 60 or less, the result is "No credential" if speed is between 61 and 80, "Small Ticket" results. Assume speed is 81or more, "Big credential" results. Unless it is your birthday(encoded as a boolean value in the function's parameters) --on your birthday, your speed can be five higher in all cases. #write your code here: caught_by_MMDA(81,True) #Output 1: Small credential caught_by_MMDA(81,False) #Output 2: Big credential
- The file DebugFour3.cs has syntax and/or logical errors. Determine the problem(s), and fix the program. // Program decides tuition based on several criteria: // 1 - 12 credit hours @ $150 per credit hour // 13 - 18 credit hours, flat fee $1900 // over 18 hours, $1900 plus $100 per credit hour over 18 // If year in school is 4, there is a 15% discount using System; using static System.Console; using System.Globalization; class DebugFour3 { static void Main() { int credits; year; string inputString; double tuition; const int LOWCREDITS = 12; const int HIGHCREDITS = 18; const double HOURFEE = 15000; const double DISCOUNT = 0.15; const double FLAT = 1900.00; const double RATE = 100.00; const int SENIORYEAR = 4; WriteLine("How many credits? "); inputString = ReadLine(); credits = Convert.ToInt32(inputString); WriteLine("Year in school? "); inputString = Readline(); year =…Describe the call statements in the code below. Describe the condtion being tested. What is the result of the call statements? def selectPrintRequest(DogNames, DogAges, request): # check if oldest option requested if request =="O": printOldestDog(DogNames, DogAges) # check if youngest option requested if request =="Y": printYoungestDog(DogNames, DogAges) # check if both outputs requested if request =="B": printYoungestDog(DogNames, DogAges) printOldestDog(DogNames, DogAges) # if no option requested, just return returnThe image for this code is below. I need help fixing this code to be inside of C#, and work as intented please (reject if you can't do C#). Screenshot of output would be great. using System; namespace GlobalWarming; int private main() //main function{ int count = 0, option1, option2, option3, option4, option5; //declaring required variables Console.WriteLine("Question 1:\n"); //printing question 1 Console.WriteLine("Which one of the following cause global warming?\n"); Console.WriteLine("1) Carbon dioxide\n2) Oxygen\n3) Nitrogen\n4) Hydrogen\n"); Console.WriteLine("Enter the correct option: "); //asking user to enter the answer cin >> option1; //storing the answer in option1 variable if (option1 == 1) //checking if the answer is correct { count++; //incrementing count variable if answer is correct } Console.WriteLine("Question…
- Function written in JavaScript Please thanks! Function 1: Password Checkerfunction _one(pwd)Create a JavaScript function that meets the following requirements:• Is passed a string representing a potential password• The function determines if the password meets the following requirementso The length of the password is between 8 – 12 characterso Contains at least 1 number (numeric character)o Contains at least 1 special character▪ Special characters are punctuation characters that are present on standard keyboard namely any character encapsulated within the following double quotes“(!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~)”o Contains at least 1 capital letter• The function should NOT employ the use of regular expressions to solve the problem• The function also displays the result (console log) of its password validation as illustrated below.• The function returns a Boolean back to the caller indicating valid or not.Hello, I was making a hangman simulation in C++. The code runs, but not fully. Could you identify the error and fix it? #include<iostream>#include<cstring> // for string class functions#include<fstream>#include <cctype>using namespace std; int main(){// define variable to get the response from user "Yes" or "No"string response;// Define index variableint w = 0;// define number of words that need to be guessed by the user assume 4const int WORDS = 4;// loopdo{// we will define the hangman bodyconst char body[] = "o/|\\|\\";// here we define the wordsstring words[WORDS] = {"MACAW", "SADDLE", "TOASTER", "XENOICIDE"};// fetch size or lengthstring xword(words[w].length(),'*');// define iterator to fetch the wordsstring::iterator i, ix = xword.begin();// define number of words to prompt for the userchar letters[26]={"\0"};// Now we define the variables which will be used in the simulationint n =0, xcount = xword.length();bool found = false, solved = false, hung =…Hello, I was making a hangman simulation in C++. The code runs, but not fully. Could you identify the error and fix it? #include<iostream>#include<cstring> // for string class functions#include<fstream>#include <cctype>using namespace std; int main(){// define variable to get the response from user "Yes" or "No"string response;// Define index variableint w = 0;// define number of words that need to be guessed by the user assume 4const int WORDS = 4;// loopdo{// we will define the hangman bodyconst char body[] = "o/|\\|\\";// here we define the wordsstring words[WORDS] = {"MACAW", "SADDLE", "TOASTER", "XENOICIDE"};// fetch size or lengthstring xword(words[w].length(),'*');// define iterator to fetch the wordsstring::iterator i, ix = xword.begin();// define number of words to prompt for the userchar letters[26]={"\0"};// Now we define the variables which will be used in the simulationint n =0, xcount = xword.length();bool found = false, solved = false, hung =…