Write an expression that prints "Special number" if specialNum is 0, -99, or 44.
Q: Vary the control variable from 1 to 100 in increments of 1 .for (unsigned int i{1}; i <= 100;…
A: Here the for loop needs to run from i=1 to 100. The syntax for for loop is…
Q: Write a program to check if a number is Mersenne number or not.
A: Given: Write a program to check if a number is Mersenne number or not.
Q: Write a condition that checks if the variable seconds is greater than or equal to 60
A: Here in this question we have asked about conditional statement if variable second is greater than…
Q: Write an expression that returns a random number between 6.5 and 56.5 (excluding 56.5).
A: EXPLANATION - Python language can be used to print the random number between any two numbers . In…
Q: Regular expression for all strings starts with ab and ends with bba is. a) aba*b*bba b) ab(ab)*bba…
A: * represents 0 or more times + represents either this or that symbol Let's explore the options and…
Q: Write an expression using Boolean operators that prints "Special number" if special_num is -99, 0,…
A: Input : Input number from user Output : Check if the number is special or not.
Q: a) Write a regular expression to match any fraction (two integers separated by / such as 75/100).…
A: Regular expression: Regular expression is used in programming for match the pattern. It is invited…
Q: What is the final result of the expression 5 % 4 + 3 - 2? a. 2 b. 6 C. 1…
A: Since modulus is the most important factor, it is estimated first (5%) 4=1. (remainder).
Q: Homework: Write a program that calculates y = -x².
A: here is Your Code #include <stdio.h> int main(){ int x=2,y; y=-x*x; printf("y =…
Q: Write a Boolean expression that evaluates to true if weight is greater than 50 pounds or height is…
A: Sometimes, for the execution of statements, the user wants to use a combination of conditions. For…
Q: Write an expression using a conditional operator that returns randomly -1 or 1.
A: Below is the expression for Your problem. For this you will have to import Random module also.
Q: Assign max_sum with the greater of num_a and num_b, PLUS the greater of num_y and num_z. Use just…
A: Algorithm : find_max function : Step 1 : initialize 0 to max_val. Step 2 : check if num_1 more…
Q: Assume that the integer variable, amount, has been initialised. Write a boolean expression to test…
A: I have provided PYTHON CODE along with CODE SCREENSHOT and 2 OUTPUT…
Q: Develop a regular expression that will accept a dollar amount. For example, $3.56 and $1,000,000 are…
A: Answer :- Use regular expression pattern '(\$[0-9]+(.[0-9]+)?)' to find all numbers that start with…
Q: write a program to enter a number from (1-100) and find sum odd number only.
A: Matlab is a matrix programming language. The Matlab script language is used to write mathematical…
Q: Write a Boolean expression that evaluates to true if either weight is greater than 50 pounds or…
A: The Boolean expression is an expression used in programming languages and it produces a Boolean…
Q: This is an operator that raises a number to a power.a. %b. *c. **d. /
A: Correct Answer: C
Q: Evaluate the postfix expression:5 6 2 ^ 2
A: Scan items from expression. If it is operand put it into stack. If it is operator pop two top…
Q: Write an expression that returns a random integer between 34 and 55, inclusively.
A: EXPLANATION - Random Function - To return random number between any two number a function is…
Q: Draw a flowchart to find the average of natural numbers from 1000 to 1500.
A: Generally, programs are the instructions given to the computer to perform certain tasks, the tasks…
Q: Using a flowgorithm, display a series of numbers in which each number (Fibonacci Number) is the sum…
A: Using a flowgorithm, display a series of numbers in which each number (Fibonacci Number)is the sum…
Q: Write a statement that assigns total_coins with the sum of nickel_count and dime_count. Sample…
A: First, we will input the nickel count and then dime_count. We will find the sum of nickel count and…
Q: Write C++ program to read characters and determine the circumference and area of three geometric…
A: #include <iostream> using namespace std; int main(){ char ch; float length, breadth,…
Q: Find the value of the following expression: 5 + 11 * 3 / 2 - 15 % 5
A: ANSWER: 21.5
Q: Write an expression using Boolean operators that prints "Eligible" if user_age is greater than 17…
A: Since you have not specified the programming language so we have answered this question in Java…
Q: Draw flowchart to find and print the summation of 20 numbers starting from (0 to 20)
A: The flowchart is given below:
Q: Q5:- Write program to calculate the equation sin(x) y(x) = x * where x = 0. 1,0. 2,0. 3, 0. 4
A: You have not specified any programming language so, I have used C++ language to write the program.
Q: Evaluate the following expressions if x is 10.5, y is 7.2, m is 5, and n is 2. x / (double)m = x /…
A: Expression evaluation:In expression (1), “double()” is used to convert integer value of “m” to…
Q: If a and b are variables containing booleans, the expression (a and b) or (not a and not b)…
A: - The question is to give a short form of the expressions : a and b not a and not b.
Q: What is the final result of the expression 5 +2*4- 2? a. 26 b. 11 C. 9…
A: The priority is taken into consideration when calculating the expression (BOD MAS rule).
Q: If a certain odd integer is represented by the expression 2n - 1, write an expression for the next…
A: In mathematics, we represent an odd integer as 2n + 1. If 2n + 1 is an odd integer, (2n + 3) and (2n…
Q: Write a Boolean expression that evaluates true if weight is greater than 50 orheight is greater than…
A: So, a Boolean expression which would evaluate to True if weight is greater than 50 or height is…
Q: Write a Boolean expression that evaluates true if age is greater than 13 and less than 18.
A: A Boolean expression a logical statement that is TRUE or FALSE. Boolean expressions can compare data…
Q: Write a Boolean expression that evaluates true if either weight is greater than 50 or height is…
A: A Boolean expression could be a logical statement that's either TRUE or FALSE Boolean expressions…
Q: Given: a = -2, b = 3, c=5. Evaluate the following expressions: a) y=a-b>a_c a+c
A: As per our company guidelines we are supposed to answer only first 3 sub-parts. Kindly repost other…
Q: Write the code to check if y is between 100 and 150 (including 150 only
A: The given code is in the C programming language Code Screenshot:
Q: True or False.
A: There are 12 variable declarations : int a = 2, b = 3, c= 4;int d = 6, e = 10, f = 11;int g = 15, h…
Q: This standard library function returns a random floating-point number in the range of 0.0 up to 1.0…
A: a. random a. is the correct option.
Q: Write an expression that evaluates to TRUE if and only if the variable x is greater than the…
A: Answer: 1. (x>y) The above expression will return true if x is greater than to y.
Q: Construct a regular expression for: Write down the regular expression for numbers where decimal…
A: In regular expressions +: represents 1 or more *: represents 0 or more /. : checks for . [0-9]:…
Q: What is the postfix form of the expression * ?((x + y) ^ 2) + ((x – 4)/3)
A: Let's first understand what is postfix notation: Postfix expression: In postfix expression operators…
Q: Write a program that takes a number as input from the user. Use conditional operator to check if the…
A: Given: Write a program that takes a number as input from the user. Use conditional operator to…
Q: a. Write a program prints all the functional numbers up to an input limit.
A: Note: Since no programming language is mentioned. I am attempting this in C++. if you need it in any…
Q: Write a regular expression that represents all 9 letters palindrome.
A: Regular expressions are special strings representing a pattern to be matched in a search operation.…
Q: The output of the statement:- x=5; if x =2; disp(x); else; disp('out of range'); end .. is one of…
A: There are many languages which are used in today's wold. Computer language can be described as a…
Q: Write an expression using Boolean operators that prints "Eligible" if user_age is greater than 17…
A: PROGRAM STRUCTURE: Takes the value of the user's age. Use the if condition to check whether the age…
specialNum ==0 || specialNum == -99 || specialNum == 44
Here the condition is true when specialNum has value 0, -99 or 44 either.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- C++: Describe how the following call by reference works. Make a comment for each line. void pxc(int& c, int& d) { int k = c; c = d; d = k; } int main() { int a = 15, b = 100; pxc(a, b); }This is the C code I have so far #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; struct employees **emps = new employees()[10]; //Added new statement ---- bartleby // function to read the employee data from the user void readEmployee(struct employees *emp) { printf("Enter name: "); gets(emp->name); printf("Enter ssn: "); for(int i =0; i <9; i++) scanf("%d", &emp->ssn[i]); printf("Enter birth year: "); scanf("%d", &emp->yearBorn); printf("Enter salary: "); scanf("%d", &emp->salary); } // function to create a pointer of employee type struct employees *createEmployee() { // creating the pointer struct employees *emp = malloc(sizeof(struct employees)); // function to read the data readEmployee(emp); // returning the data return emp; } // function to print the employee data to console void display(struct employees…Fix the following c++ code : #include<iostream>using namespace std;void Ashraf(int [][],int,int);int main(){int a[2][3];Ashraf(a,2,3);}void Ashraf (int a[ ] [], int R, int C){for(int r=0; r<R; r++){for(int c=0; c<C; c++){a[r][c]=1;cout<<a[r][c]<<"\t";}cout<<endl;}
- Anagram words Write a C code that asks users to enter two words, one after the other and checks if these words are anagrams (permutations of the same letters). For instance, the words “smartest” and “mattress” are anagrams. Examplea Run 1: Please enter first word: lookplease enter the second word: coolSorry! “cool” and “look” are not anagrams. Run 2: Please enter first word: masters please enter the second word: smartes Yes! “masters” and “smartes” are anagrams. Hint: If you sort the two words that are anagrams, they will become identical! For instance, “smartest” and “masters” both sort to “aemrsstt” You can use all functions in <string.h> Sorting a string is exactly similar to sorting an array. You just need to know the length of the string and make sure you do not touch the terminating null.>> IN C PROGRAMMING LANGUAGE ONLY << COPY OF DEFAULT CODE, ADD SOLUTION INTO CODE IN C #include <stdio.h>#include <stdlib.h>#include <string.h> #include "GVDie.h" int RollSpecificNumber(GVDie die, int num, int goal) {/* Type your code here. */} int main() {GVDie die = InitGVDie(); // Create a GVDie variabledie = SetSeed(15, die); // Set the GVDie variable with seed value 15int num;int goal;int rolls; scanf("%d", &num);scanf("%d", &goal);rolls = RollSpecificNumber(die, num, goal); // Should return the number of rolls to reach total.printf("It took %d rolls to get a \"%d\" %d times.\n", rolls, num, goal); return 0;}A Millenial is someone born between 1981 and 1996 (inclusive). Using boundary analysis write test cases to test the IsMillenial function: public bool IsMillenial(int year) that takes a year of birth (in the Gregorian Calendar) and returns true if the person is a millenial and false if it isn't. If the year is not a valid Gregorian Calendar year then the function throws ArgumentOutOfRangeException. Note: There is total of 13 test cases. using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Collections.Generic; [TestClass] public partial class { // Your code starts here // Your code ends here }
- #include using namespace std; bool isPalindrome(int x) { int n=0,val; val = x; while(x > 0) { n = n * 10 + x % 10; x = x / 10; } } int main() { int n; cin >>n; if(isPalindrome(n)) { cout <Programming in C#: Write a console-based application that displays every perfect number from 1 through 10000. A number is perfect if it equals the sum of all the smaller positive integers that divide evenly into it. For example, 6 is perfect because 1, 2, and 3 divide evenly into it and their sum is 6. Use format strings(field size 8, right alignment) to show all perfect numbers. Display the results as seen below. 6 28 496 8128java c++ here is my question (Evaluate expression) Modify Listing 20.12, EvaluateExpression.java, to add operators ^ for exponent and % for remainder. For example, 3 ^ 2 is 9 and 3 % 2 is 1. The ^ operator has the highest precedence and the % operator has the same precedence as the * and / operators. Your program should prompt the user to enter an expression. Here is a sample run of the program Enter an expression: (5 * 2 ^ 3 + 2 * 3 % 2) * 4(5 * 2 ^ 3 + 2 * 3 % 2) * 4 = 160
- #include <iostream> #include "Class_Circle.h" using namespace std; static int x = 5; void setRaduis(int r){ cout<<"I am a function outside the class "<<r<<endl; } int main() { Circle c1; c1.setRaduis(10); c1.printCircle(); setRaduis(20); Circle c2; c2.setRaduis(30); //if (c1==c2) error bool equals = c1.isEqual(c2);//c = &c2 if (equals) cout<<"the circles are equals"; else cout<<"the circles are not equals"; cout << "Hello world!" << endl; Circle c3(40); c3.printCircle(); Circle arrayCircle[5]; int r; for (int i =0;i<5;i++){ cout<<"enter circle "<<i<<" radius: "; cin>> r; arrayCircle[i].setRaduis(r); } for(int i = 0;i<5;i++){ cout<<"the circle "<<i<<" info :"<<endl; arrayCircle[i].printCircle(); } x = 10; cout<<"static x =" <<x<<endl; cout<<"call static func from objct:"<<endl; c1.printNumberOfObjects(); c3.printNumberOfObjects();…(Evaluate expression) Modify Listing 20.12, EvaluateExpression.java, to addoperators ^ for exponent and % for remainder. For example, 3 ^ 2 is 9 and 3% 2 is 1. The ^ operator has the highest precedence and the % operator has thesame precedence as the * and / operators. Your program should prompt theuser to enter an expression. Here is a sample run of the program: Enter an expression: (5 * 2 ^ 3 + 2 * 3 % 2) * 4(5 * 2 ^ 3 + 2 * 3 % 2) * 4 = 160 Here is the Listing 20.12 to modify: import java.util.Stack; public class EvaluateExpression { public static void main(String[] args) { // Check number of arguments passed if (args.length != 1) { System.out.println( "Usage: java EvaluateExpression \"expression\""); System.exit(1); } try { System.out.println(evaluateExpression(args[0])); } catch (Exception ex) { System.out.println("Wrong expression: " + args[0]); } } /** Evaluate an expression */ public static int evaluateExpression(String expression) { // Create operandStack to store operands…Below is the starting code for this homework assignment #include <stdio.h> //1. struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; //2. struct employees e = {"kim deen", {1,2,3,4,5,6,7,8,9}, 1998, 35000}; //3. void display(struct employees *e) { printf("%s", e->name); printf(" %d%d%d-%d%d-%d%d%d%d", e->ssn[0],e->ssn[1],e->ssn[2],e->ssn[3],e->ssn[4],e->ssn[5],e->ssn[6],e->ssn[7],e->ssn[8]); printf(" %d", e->yearBorn); printf("\n$%d.", e->salary); } int main() { display(&e); return 0; }