= {a, b}*, w has two consecutive b's or starts with b and ends with a} b(a+b)* + a(a+b)*b a(a+b)* + (a+b)*bb(a+b)* f them
Q: for (int i-2; i>=3; ) cout<<*: for (char i='c'; i<'f; i++) cout<<i; cout<<i; int i, j: for (i= 1; i…
A: lets analyse the given codes for output: for(int i=2;i>=3;)//here i is intialized to 2, loop…
Q: in c# Write a console app that inputs a sentence from the user (assume no punctuation), then…
A: The program is written in step 2
Q: • R7.17Consider the following code that repeats a C++ string three times. string a = "Hello";…
A: A C program for the given criteria is as follows, File name:”main.c” #include <stdio.h>…
Q: private: int num; }; Q3: Overload the prefix ++ operator to prefix increment num by 1. Q4: Overload…
A: Pre - Increment Operator Syntax: WholeNumber operator++(); Post - Increment Operator Syntax:…
Q: The coding language is python The code in there may or not be correct I was playing around with it…
A: PROGRAM: # The user in prompted for input and stored in userInput userInput = str(input("Enter the…
Q: 3. Mathematical Recurrence. Create a program that calculates values for the following mathematical…
A: Java code for given problem :- class Main { public static int f(int n) { // base…
Q: JAVA Programming Problem 5 – CharacterArray Write a program which will store the following string…
A: i wll provide two solutions for this question public class CharacterArray {public static void…
Q: 1- int a = 1, b = 0; %3D if (a -1) {a = b = 23 ;} cout << x << " "<y< endl; 2- int x; for (x = 1;…
A: I think the x and y in the first program may be a and b. If so, here is the output and the correct…
Q: plete the whole code a..
A: The code is below:
Q: Create a list of 20 random grades between 0 and 100. Write the code for filtering that generates a…
A: for x in range (1,20): #using randint to get all random values between 1 and 100…
Q: |#include "stdafx.h" #include using namespace std; |int main(int argc, _TCHAR* argv[]) { char…
A: Answer you have to make changes in code as code #include <iostream>#include…
Q: * TRUE OR FALSE FALSE TRUE for (int i = 0; i<5; i--) std::cout<< ; Bill[i]<<endl We can use the…
A: Q1. True Q2. False Q3.True Q4.True Q5.True
Q: In this lab, you use what you have learned about searching an array to find an exact match to…
A: #include <iostream>#include <string>using namespace std; int main() { string…
Q: #include using namespace std; int lookup(int arr[], int num, int cnt for(int i = 0;i<cnt;i++){…
A: Here the code :- hlt: b 120000c50 <hlt> nop lookup(int*, int, int): daddiu sp,sp,-48 sd…
Q: int i,j; for(i=1;ii;--j) cout<<"-"; } **_* ** **. ***.
A: CODE WITH OUTPUT:-
Q: Mr. X is a student of Computer Science. He is facing a problem and needs your help to solve it. The…
A: We will use an array to hold the user input integers. An array is a data structure that holds…
Q: struct ID { int x; int y; }; struct name { ID r; }; int main() { name a[2]; for (int i=0;i<2;i++) {…
A: Given code is struct ID { int x; int y; }; struct name {ID r; }; int main() { name a[2]; for(int…
Q: a) b) C) d) CO 1 123 2 4 5 6 7 8 9 10 11 12 20 19 TELE 345 13 #include #include int main(){ 14 15…
A:
Q: void foo (const char* s) { const int* p = (int*) (s int i-3; while(i){ printf("%c", *C(char %3D p++;
A: The explanation is in the following step.
Q: include #include using namespace std; int main () { vector v (8); for (unsigned i = 0; i < v ();…
A: 1.v.size() 2.v[i] 3.v.size() 4.v[i]
Q: (b) #include int main() { int a, b; a = -3 -- 3; b = -3 -- (-3); printf ( "a = %d b = %d\n", a, b )…
A: The code is having following errors which are listed below:
Q: // MichiganCities.cpp - This program prints a message for invalid cities in Michigan. // Input:…
A: I have written the program using C++ PROGRAMMING LANGUAGE OUTPUT : CODE : //…
Q: int a=6; int s-%3; while(a>10) S=s+a; cout<<"a="<<a<<endl; a+=23; cout<<"a="<<a; A) a=8 b=6 B. a=6…
A: Given : int a=6; int s=0; while(a>10) { s=s+a; cout<<"a="…
Q: include doublevalue (int z) { z*=2; --z; return z;} int main( ) {int a, b; a=16; b=23;…
A: In the above program, aa,bb,f are not declared doublevalue function is returning int value, but…
Q: What is the effect of the nested repetition structures? int region = 4; int r = 0; int state = 12;…
A: Please find the answer below :
Q: // MichiganCities.cpp - This program prints a message for invalid cities in Michigan. // Input:…
A: You need to check with each and every element in the array of strings and if it equals the input…
Q: 7 #include #include using namespace std; int val (char c) 11 E { 8 9 10 if (c >= '0' && c = 'A' &&…
A: This is c code written in C++ form
Q: Code uses C++ language If the user chooses to generate a Pentagon o This is a combination of a…
A: In the given statement, we have been asked to print the shape like pentagon Which should contain…
Q: C Programming Write a program that reads an integer from the user (keyboard), namely n. Your…
A: As per the given problem statement we are required to develop a C code which take an input of…
Q: # include using namespace std; int sum (int , int ); int c = 1; int main () int a, b; cout « "enter…
A: PROGRAM CODE: # include <iostream>using namespace std;int sum(int , int ) ;int c = 1;int…
Q: Define an enumeration type, triangleType, that has the values scalene, isosceles, equilateraland…
A: Given: triangleType, that has the values scalene, isosceles, equilateraland noTriangle Write a…
Q: ublic static int sub(int arg1, int arg2) {
A: create "Online shopping System" with c++ following this option 1. Add item(using queue with array…
Q: int i 0; = while (i < 10) { cout << i << endl; i=i+2; }
A: I HAVE PROVIDED SOLUTION IN STEP2
Q: #include using namespace std; int pc(int a, int b) { if (b == 0) return a; return pc(b, a % b); }…
A: The correct answer for the above question is last option => Greatest Common Divisor of a and b.…
Q: =i :in below code ;int i = 0 for (i = 0;i == 0;i++) } ;cout<<i {
A: Given:
Q: Refer to the statement below, #include void main() { int i; int…
A: Algorithm: for (initialExpression; testExpression; updateExpression){ // body of the…
Q: c structure
A: We need to write a C program for the given scenario.
Q: int main(int argc, char **argv) { float *rainfall; float rain_today; // rainfall has been…
A: Here is the answer:-
Q: Programming Exercise 10 in Chapter 6 asks you find the mean and standard deviation of five…
A: The solution to the given problem is below.
Q: Quiz.8.2 *8.8 (Binary to decimal) Write a function that parses a binary number as a string into a…
A: PROGRAM CODE: # defining functiondef binaryToDecimal(binaryString): # initializing decimal…
Q: using namespace std; int main() int i, m=0,n=4; float arr[100] (55,66,88,1); for(i=0; i<n; ++i) {…
A: The above is a cpp program. This program is finding the smallest element in array by continuously…
Q: a. 40 15 #include using namespace std; b. 50 15 40 30 int main () C. d. 50 30 int arr(4]…
A: Q1. arr [4][3] is a 2 dimensional array of 4 rows and 3 columns. int * a is a pointer pointing to…
Q: int_tmain(int argc, _TCHAR* argv[]) { int A=35, B=65; if(A>=40 || B<=75) { cout<<"lf will execute";…
A: The given problem is related to C++ programming and operators in the programming. The requirement is…
Q: Write in C language Description Gomoku, also called Five in a Row, is an abstract strategy board…
A: #include <stdlib.h> //stdlib header#include <stdio.h>#define MAX 100 //maximum…
Q: rin t] (Replace strings) Write the following function that replaces the occurrence of a substring…
A: #include <iostream>#include <string.h>using namespace std; bool same(string& s,…
Q: 5.19 (Rectangle of Hashes) Write a function that displays a solid rectangle of hashes whose length…
A: Please find the answer below :
Q: Write a program in C ++ to generate 35 random numbers between 1 and then print each 7 numbers on one…
A: Please find the answer below :
Q: 1) 2) 3) int main) int main) int main() first 64): f.show(): return 0 1D3 d1(6k point d2(3,2):…
A: #include <iostream> class first{private: int f;public: // constructor first(int f) { // hold…
Q: Strings Starting with "TH") Write a program that reads a series of strings and prints only those…
A: #include <stdio.h>#include <string.h>int main(){ int n; //variable for…
Q: I'm stuck on this question and I don't know how I should be approaching this. What should I do?
A: #include<iostream> using namespace std; class RatNum{…
Step by step
Solved in 2 steps
- JAVA LANGUAGE CODE Postfix Calculator by CodeChum Admin One good implementation of computing infix expressions is to transform them to postfix and then evaluate via the postfix expression. Infix expressions is the common way of writing arithmetic expressions. The binary operator come between them as shown below: 2 * 5 + 9 - 10 / 20 In postfix expressions, the operands come first before the operator: 2 5 * 9 + 10 20 / - A stack can be used to evaluate postfix expressions. The operands are pushed onto the Stack and when an operator is found two operands are popped and the operation is performed and finally the result is pushed back onto the Stack. The final answer will be the lone element of the Stack. Input The first line contains a positive integer n representing the number of postfix expressions. What follows are n postfix expressions themselves. 5 10 20 + 30 15 2 * + 100 20 30 + / 90 20 10 + + 0 / 9 3 - 10 + 2 * Output A single line containing the result of…f : {1, 2, 3} ® {a, b, c, d} f(1) = c f(2) = b f(3) = a g : {a, b, c, d} ® {x, y, z} g(a) = y g(b) = x g(c) = x g(d) = z Find the composition gofC++ A robot is initially located at position (0; 0) in a grid [?5; 5] [?5; 5]. The robot can move randomly in any of the directions: up, down, left, right. The robot can only move one step at a time. For each move, print the direction of the move and the current position of the robot. If the robot makes a circle, which means it moves back to the original place, print "Back to the origin!" to the console and stop the program. If it reaches the boundary of the grid, print \Hit the boundary!" to the console and stop the program. A successful run of your code may look like:Down (0,-1)Down (0,-2)Up (0,-1)Left (-1,-1)Left (-2,-1)Up (-2,0)Left (-3,0)Left (-4,0)Left (-5,0)Hit the boundary! or Left (-1,0)Down (-1,-1)Right (0,-1)Up (0,0)Back to the origin! About: This program is to give you practice using the control ow, the random number generator, and output formatting. You may use <iomanip> to format your output. You may NOT use #include "stdafx.h".
- Write in C language Description Gomoku, also called Five in a Row, is an abstract strategy board game. It is traditionally played with black and white stones on a 19×19 board.The winner is the first player to form an unbroken chain of five stones horizontally, vertically, or diagonally. Please write a program to determine if there is a winner or not. Input Input content 19 line, each line content 19 character and a new line O represent white stone, X represent black stone and _ means there is no stone on that spot. Output Output "White" if white win, "Black" if black win, "No winner" if no one win.int f(int &k){k++;return k * 2;}int main(){int i = 1, j = -1;int a, b, c;a = f(i) + i/2;b = j + f(j) + f(j);c = 2 * f(j);return 0;} What are the values of a, b and c id the operands in the expressions are evaluated from left to right and then what are the values when its evaluated right to left?if L1={ab,b} L2={abb,bb} then L1L2= * O {ababb,abbb,abbab,bbab} O {ab,b,abb,bb} O {ababb,abbb,babb,bbb} O {abbab,abbb,bbab,bbb}
- Java C++ Write a recursive function that accepts two arguments into the parameters x and y. The function should return the value of x times y. Remember, multiplication can be performed as repeated addition: 7∗4=4+4+4+4+4+4+47 * 4=4+4+4+4+4+4+47∗4=4+4+4+4+4+4+4In C programing Write a recursive function that returns the product of the digits of its integer input parameter, n. You may assume that n is non-negative. For example, productDigits(243) should return 24, since 2 x 4 x 3 = 24.int productDigits (int n) {void fact(int num) { int k,f=1; for (k=1;k<=num; k++) f=f*k; cout<< f; int main() { int arri[3]={3,2,1} ; for(int i=0;i<3;i++) fact(arri[i]); } 261 O 621 O 7 462
- IN JS LANGUAGE Given the above parameters, implement a function that returns a string representing the plant (see the examples below for a better visualization). Examples plant("@", 3, 3, 25) "---@@@_@@@---@@@"Matrix Problem Code this in C Write a program that reads two matrices of integers. It then generates the sum, difference, and product of the two matrices. The sum of the two matrices of the same size is a matrix with elements that are the sums of the corresponding elements of the two given matrices. Addition is not defined for matrices of different sizes. If A and B are matrices of the same size, then we define subtraction as follows: A – B = A + (-B). Thus, to subtract matrix B from matrix A, we simply subtract corresponding elements. To multiply a matrix by another matrix we need to do the "dot product" of rows and columns. The "Dot Product" is where we multiply matching members, then sum up: (1, 2, 3) • (7, 9, 11) = 1×7 + 2×9 + 3×11 = 58 We match the 1st members (1 and 7), multiply them, likewise for the 2nd members (2 and 9) and the 3rd members (3 and 11), and finally sum them up. Use the following definitions:#define ROW 6#define COL 6void add(int matrixResult[][COL],int…int func(int a, int b) { return (aSEE MORE QUESTIONS