DWhich is valid C expression? a) int my_num = 100,000; b) int my_num = 100000; c) int my num = 1000; d) int $my_num = 10000;
Q: 12- With the following declaration: int [.] points = {{300, 100, 200, 400, 600}, {550, 700, 900,…
A: Here we are declaring a 2D array with 2 rows and 5 columns. As we know that array can be accessed…
Q: When the following main function runs, what will display on the screen? int main() {int number;…
A: Output: The value is number
Q: int main() { int i, salary[10], range[9]={0, 0, 0, 0, 0, 0, 0, 0, 0}; double gross[10], total[10];…
A: The regular expression (RE) contains the symbol 0 and 1 only. The expression is:…
Q: Financial application: compare loans with various interest rates) Write a program that lets the user…
A: Actually, program is a executable software that runs on a computer.
Q: #include using namespace std; void myfunction(int num2,int num1); int main(){ myfunction(5,2);…
A: Please find the answer below :
Q: Assume c is a char variable. What value does c hold after each of the following statements…
A: Answer: The functions toupper() and tolower() are in-built function in c++. The function toupper()…
Q: My code #include using namespace std; int main () { float…
A: The following changes can be done to make the program more readable: Include spaces between the…
Q: Assume that qty and salesReps are both integers. Use a type cast expression to rewrite the following…
A: Assume that qty and salesReps are both integers. Use a type cast expression to rewrite the following…
Q: #include using namespace std; void myfunction(int num2, int nu int main(){ myfunction(5,2); return…
A: Function declaration is done in the third line saying myfunction accepts two integer parameters and…
Q: #include int main() { int age; printf("Enter your age:"); scanf("%d",&age); if(age >=18)…
A: The if else statement is used to perform the operations based on some specific condition.
Q: #include using namespace std; void car(){ { cout << "Audi R8"; int main() { car("BENZ"); return 0;…
A: It will give compile time error. as, function Car has NO arguments but during function call ONE…
Q: #include using namespace std; int main() { int specialNum; cin » specialNum; if (/put your answer…
A: specialNum == 0 || specialNum == -99 || specialNum == 44 This Expression should be filled to…
Q: 1. Kilometer Converter Write a program that asks the user to enter a distance in kilometers, then…
A: Both python programs are coded in the next steps.
Q: #include #include void main(void) (int number; Cout > number; if ( number > 100) cout <<" number…
A: The above program is for checking if number>100 then a message is displayed "number is greater…
Q: Part C: Assuming variable starts with the value 10, what will the following code fragment prints…
A: This question is checking the performance of the increment operator. Normaly when value++ or ++value…
Q: Subscripted variable is any type such as (A) Int (B) Float (C) Int, float or char (D) Char
A: Variables are used to store information to be referenced and manipulated in a computer program.
Q: Q5: Complete the function that calculates the position of an object at any time t> 0. The initial…
A: code def calculate_position(s0,u0,a,t): position = u0*t + 0.5*a*t*t position=position+s0…
Q: int main() #Fil in the code to define and initialize to 1 the variable onth float total = 0, rain,…
A: A sentinel value is a special value that is used to terminate a loop. In the given problem the month…
Q: What will the following code display? int number = 6; ++number; cout << number << endl;
A: ++ number means pre increment means first increment the number and then print number =6 ++number =7…
Q: #include int main() { int age; printf("Enter your age:"); scanf("%d",&age); if(age >=18)…
A: You are not eligible for voting
Q: Function Name: dominosTime() Parameters: N/A Returns: None Description: During the summer, you…
A: Python used to answer this question
Q: Show the output of the following code:
A: a> ans: Program a after execution ,its output will be null. Because we have given amount=5;…
Q: int isbivisiblebye(int num) (m ) reture isDivisibleBy6( ); num eturn 13 10) return reture…
A: #include <stdio.h> int isDivisibleBy6(int num){ if(num < 6) return…
Q: 2.26 (Multiples) Write an application that reads two integers, determines whether the first is a…
A: C++ Program for above : #include <iostream> using namespace std; int main() { //read…
Q: If value is an identifier of int type and is holding value 200, is the following statement correct?…
A: introductoin:Int datatype is used in holding values:
Q: A. If you have the following code: int a = 2, b = -3, c 2; %3D bool vall = false, val2 true; char ch…
A: There are many expression given with one code as per mentioned below, int a=2,b=-3,c=2; bool…
Q: int num = 1; while (num * num <= 50) cout << num << " num = num + 2; cout << endl;
A: int num=1; while(num*num<=50){ cout<<num<<" "; num=num+2; }…
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: 1 #inlcude using namespace std; 3 int main() 4日{ 2 float a; cin>>a; if (a==0): cout0): 10 11
A: Given:
Q: When using a printf() statement, what syntax do you use to print the value of an "int"? %d %c %s %f
A: - The question wants to know that when using a printf statement what syntax we use to print an…
Q: A program contains the following function. int cube(int num) {return num * num * num; }Write a…
A: Function Call The function accepts a number of type int as a parameter and returns the cube value of…
Q: What will be printed on the console? 1. What will be printed on the console char c = '0'; if(c >…
A: there is an error in the first line so the first error is: error: expected ‘;’ before ‘)’ token…
Q: Q5: Complete the function that calculates the position of an object at any time t> 0. The initial…
A: Input : Given the s0,u0, a, and t. Output : Value of position.
Q: #include int main() { int age; printf("Enter your age:"); scanf("%d",&age); if(age >=18)…
A: The if-else statement is used to perform the operations based on some specific condition
Q: The following declaration, program, and program segment has errors. Locate as many as you can.…
A: One may want to set a default value for the property member, and therefore when not started would…
Q: Using the following statements, what value is displayed? *include #include using namespace std;…
A: The program is written in the C++ programming language.
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: Look at the following code. int x = 7; int *ptr = &x;What will be displayed if you send the…
A: Given: Look at the following code. int x = 7; int *ptr = &x;What will be displayed if you send…
Q: A __________ specifies which parameter an argument should be passed into. a. named argument b.…
A: Named argument: C# specifies the parameter to which an argument must be passed to. For specifying…
Q: void functionOne(int number) { if (number < 10) time++; else { for (int i= 0; i< number; i++)…
A: Ans 1: The big oh notation of the first given function is O(n). As per the given function the for…
Q: #include using namespace std; int main() { int a,b; cin>>a>>b; int i = a; int total = e; i++; }…
A: The fixed bug code
Q: 7. (Medium) (Financial application: initial deposit amount) Suppose you want to deposit a certain…
A: c++ program #include<math.h>#include <iostream>using namespace std; //driver functionint…
Q: Consider the following code segment: int numFeet, numInches; //number of feet // number of inches…
A: Note: Here you didn't mention any programming language So We are using the C++ programming language…
Q: The Barking Lot is a dog day care center. Design a flowchart or pseudocode for the following: d.…
A: Pseudocode :- start Declaration num idNm String nme String breed num age num weigh num bil num QUIT…
Q: #include void main( ) { = 1; for (int i = 1, i >num; if ( num> 0 ) sum = sum + num; cout<<“the sum…
A: EXPLANATION --> Space is missing between int and num. Closing braces is missing of main…
Q: The following declaration, program, and program segment has errors. Locate as many as you can.…
A: Lets see the solution.
Q: 7. (Medium) (Financial application: initial deposit amount) Suppose you want to deposit a certain…
A: C++ In this program , we just have to enter all values required to calculate initialDepositAmount .…
Q: int main() int NUMBER, BALANCE; printf("Please enter a number "); scanf("%d", &NUMBER); BALANCE =…
A: Code: #include<stdio.h> int main(){ int N,B; printf("Enter a number: "); scanf("%d…
Q: fION 15 To assign a double variable d to an int variable x, you writ Ox= d; Ox= (long)d x (int)d3;…
A: This question comes from Programming Language which is a paper of computer science. Let's discuss it…
None
Step by step
Solved in 6 steps with 4 images
- Assume that qty and salesReps are both integers. Use a type cast expression to rewrite the following statement so it will no longer perform integer division.unitsEach = qty / salesReps;If value is an identifier of int type and is holding value 200, is the following statement correct?char code = value//Below is the starting code for this homework assignment// #include <stdio.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; struct employees e = {"kim deen", {1,2,3,4,5,6,7,8,9}, 1998, 35000}; 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; }
- int fun(int k){ return ( ); void main(){ int n; cin >> n; n = n * fun(n); <-- 1 Fill in the appropriate statement and expression in fun, so that when it is called in main, and after the execution of the statement marked 1, the value of n would always be n3.Individual Arguments is reference arguments that are in consecutive order True O False O4.23 (Financial application: payroll) Write a program that reads the following information and prints a payroll statement: Employee’s name (e.g., Smith)Number of hours worked in a week (e.g., 10)Hourly pay rate (e.g., 9.75)Federal tax withholding rate (e.g., 20%)State tax withholding rate (e.g., 9%) A sample run is shown below:Enter employee's name: SmithEnter number of hours worked in a week: 10Enter hourly pay rate: 9.75Enter federal tax withholding rate: 0.20Enter state tax withholding rate: 0.09Employee Name: SmithHours Worked: 10.0Pay Rate: $9.75Gross Pay: $97.5Deductions:Federal Withholding (20.0%): $19.5State Withholding (9.0%): $8.77Total Deduction: $28.27Net Pay: $69.22 Requirement: Requirements: Input and output must match the format provided in the exercise sample runs Currency must be displayed properly: You must have a dollar sign ($) and 2 places after the decimal (dollars and cents) You must use printf rather than the goofy trick from earlier chapters Appropriate…
- c## please Write a Console Application that reads two integers, determines whether the first is a multiple of the second and displays the result. [Hint: Use the remainder operator.]Subscripted variable is any type such as (A) Int (B) Float (C) Int, float or char (D) CharError; the string "int16_t" and "int8_t" must occur somewhere in your code. where to put those string into he code Here is my code: #include <stdio.h> typedef struct define { short mantissa; char exponent; } Float24_t;
- My code #include <iostream>using namespace std;int main (){ float meal_cost,total_bill,tax_amount,tip_amount; cout <<"Enter a meal charge:"; cin >> meal_cost; tax_amount = 0.0675 * meal_cost; tip_amount = 0.2 * (tax_amount + meal_cost); total_bill = meal_cost + tax_amount + tip_amount; cout <<"The meal cost is"<< meal_cost <<endl; cout <<"tax amount" << tax_amount <<endl; cout <<"tip amount" << tip_amount <<endl; cout <<"total bill" << total_bill <<endl; return 0;} Two Comment I got: 1- Although this one is one of the shortest ones I've seen, I think the readability of the code could be improved with a couple of blank lines here and there. I'm pretty sure the computer just skips them with no effect on run speed. Also, there are a couple of weirdly placed tabs for the lines "cin >> meal_cost;", and "tax_amount = 0.0675 * meal_cost;". These two lines should be…Given the declaration:char myStr[26];char yourStr[26] = "Arrays and Strings";a. Write a C++ statement that stores "Summer Vacation" in myStr.b. Write a C++ statement that outputs the length of yourStr.c. Write a C++ statement that copies the value of yourStr into myStr.d. Write a C++ statement that compares myStr with yourStr and stores the result into an int variable compare..c## Write a Console Application that reads two integers, determines whether the first is a multiple of the second and displays the result. [Hint: Use the remainder operator.]