In the manual tracing, show the value of variable my_str every time its value changes: #include #include #include int main(){ char arr[5][20] = ("Elon Musk", "Sundar Pichai", "Steve Wozniak", "Steve Jobs", "Mark Zuckerberg"}; char my_str[50], temp_str[50]; int a = LAST_FOUR_DIGIT_OF_YOUR_STUDENT_ID % 5; int b = LAST_FOUR_DIGIT_OF_YOUR_STUDENT_ID % 4; int c = LAST_FOUR_DIGIT_OF_YOUR_STUDENT_ID % 6; strcpy(my_str, arr[a)); my_str[b] = toupper(my_str[c]); strncpy(temp_str, arr(b), c); strcat(my_str, temp_str);
Q: static double some_calc(int arr[], int len) { int index = 0; double foo_1 = 1, foo_2 = 1; while…
A: The function name is some_calc which is taking two parameters. One parameter is integer array and…
Q: Write a program that takes 3 integers as an input from the user and display them in ascending order…
A: // here is my c++ code #include <iostream>// header file using namespace std;void…
Q: You have been hired by the Department of Computer Science at Wayne State University to write a C++…
A: #include <iostream> //header file using namespace std;//Function to find count of grade A-int…
Q: Subtract each element in origList with the corresponding value in offsetAmount. Print each…
A: The answr is given below:-
Q: I keep getting these errors when I run the code below: Code is in C++ ____animal.cpp_______…
A: Answer: horsemain.cpp: #include "horse.h"#include<limits>#include<cstdlib> void…
Q: Which statement/s will declare an array of integers that has 8 elements? A. int] n = new int[8]; B.…
A: Hello Students. Warm welcome from my side. Hope you are doing great. I will try my best to answer…
Q: Debugging Informatlon for IAP Test3 O COMPILER STACK TRACE None PROGRAM EXECUTION STACK TRACE None…
A: EXPLANATION: - 8 9 7 6 5 4 3 2 1 0 The brief message given in output states things present in…
Q: #include #include using namespace std; int main() { const int ROW_HOURS=6; //declare…
A: The solution for the above given question is given below:
Q: c++ int * board; int rows; int columns; cout > columns >> rows; cout << endl; board= new…
A: Arrays are basically of 2 types:1. Static arrays.2. Dynamic arrays. Static arrays:- Array in…
Q: #include int main() short int i = 20; C - printf ("%d, %d, %d\n", sizeof (i), sizeof(c), sizeof (c…
A: Given, Code: #include <stdio.h> int main() { short int i = 20; char c = 97;…
Q: include tinclude tinclude typedef atruct 1 int fld; } item t: static int d-100; static void…
A: Here within the given code in C , the malloc function , the pointers and therefore the strdup…
Q: For this C++ called getArrayLength that counts up the number of elements in an array of integers…
A: Please find the answer below :
Q: ITCS114 - Computer Programming II Lab Assignment # 2- Chapter 07 Write a Java program that will read…
A: Answer Code in Java import java.util.*; public class Solution { public static void…
Q: Given: an int variable num, an int array current that has been declared and initialized, an int…
A: First Part Code #include <iostream> using namespace std; int main(){ int num; int…
Q: an intelligent number editor system, a menu driven application having following methods. The…
A: It is defined as a direct descendant of C programming language with additional features such as type…
Q: My professor wants this: Write a program that prompts the user to enter a full name consisting of…
A: import java.util.Scanner; public class Main{ public static void main(String[] args) {…
Q: Using your knowledge in c++. Demonstrate a project that contains a file called "Class Grades.txt",…
A: #include<iostream>#include<iomanip>#include<string>#include<fstream> using…
Q: include include tinclude typedef atruct I int fld; 1 item t; static int d- 100; static void…
A: Dear Student, For allocating static memory stack is used where as heap is used for dynamic memory…
Q: Where I get my c++ code wrong? Please help me.
A: The error in the code is specified below with explanation.
Q: Q1. Produce a method that reads in a set of values (double) from the user and returns them. Use this…
A: Given code is Java code it returns the student grades. By using the public static double[]…
Q: of the following: 2. How do you create a variable with the floating number 2.8? dow do you insert…
A: The correct option is (a) // is used to insert a comment in c++.
Q: #include void main () { int z[4][2]={{1, 2}, {3, 4}, {5, 6}, {7, 8}}; int a, b, c; for (a = 0; a <…
A: Given Program: // Online C compiler to run C program online#include <stdio.h> int main() {…
Q: Make a C# programming with class and method(pre written class)of: 1. Ascend! by CodeChum Hey I’ve…
A: // Code using System;class HelloWorld { static void Main() { Console.WriteLine("Enter the…
Q: QUESTION 31 Write a C# program named WordProcess that includes a method named SortAndDisplay(...).…
A: C# Program for the given problem :- using System; class MainClass { public static void…
Q: Place the following parallel arrays as globals in your program class (before the main() ). static…
A: import java.util.*;import java.io.*;class Test163 { static String[] planetname =…
Q: Can you correctly complete the blank code sections? #include #include struct Part { int…
A: As there is no clear explanation in the question about what the program does. Here is the something…
Q: If integer requires two bytes space, then what will be the size of the following 'C' array? int…
A: The grouping of comparable data objects stored at adjacent memory regions is known as an array.…
Q: 1. Write a method that returns an int array using user's inputs from the console window. The method…
A: Java Code :- package homework; import java.util.Arrays; import java.util.Scanner; public class HW8…
Q: You have created and populated a constant array of values in pseudocode as follows: INITIALIZE…
A: Given: INITIALIZE names names(1) = 'Joe' names(2) = 'Mary' names(3) = 'Heather' names(4) =…
Q: Write a program that calculates the multiple body mass index (BMI) where the program read multiple…
A: As per the given question, we have to design a C program for calculating BMI for multiple inputs.…
Q: How can i replace this rooms = (struct Room*) malloc(SIZE * sizeof(struct Room)); in this code?…
A: To remove the malloc function from given program code, we can use array of runtime bound method, in…
Q: #include int main() short int i - 20; char c = 97; printf("%d, %d, %d\n", sizeof(i), sizeof(c),…
A: Here is the explanation about the size:
Q: Which statement/s will declare an array of integers that has 8 elements? int[] n = new int[8]; int…
A: EXPLANATION: The general declaration of the variable of array type requires the following items:…
Q: There is an array of strings named strs. Which of the below Java statements correctly find the count…
A: --- The syntax of chartAt() is: string.charAt(index) So option 1 is wrong. --- The length variable…
Q: There is an array of objects having size 10, and we have to retrieve a data value from 5th object.…
A: As we know that the index of an array starts from 0. If we want to find out the 5th element the…
Q: The files provided in the code editor to the right contain syntax and/or logic errors. In each case,…
A: Required Java code with correct syntax and logic errors provided below :
Q: Code in C++ Language As a cashier, you would always hate those times when customers choose to take…
A: The code in C++ is as follows #include <iostream> using namespace std; int main() { cout…
Q: Write a console application with several functions that deal with a two-dimensional array of…
A: As the language is not specified answer written in c++ rand() function helps to generate random…
Q: Write a program that prompts the user to input a string and outputs the string in uppercase letters…
A: C++ code
Q: In Java list all the values of the array after the function is called A. static void…
A: In Java list all the values of the array after the function is called elements.
Q: What will be the output of the following program? struct subject{ char "sub[3];}; int main() {…
A: In the given program, there is a structure subject. It has one field sub, which is the array of…
Q: Please give the correction from this code, where I made the mistakes. The extra two output shown…
A: The programme has been updated by removing all the errors in the code. The two extra outputs were…
Q: comment the below code
A: Program: // C++ version 14#include<iostream>#define SIZE 2500using namespace std; // global…
Q: * Question 3b write a method with the following specification * name : DisplayIntArray * arguments:…
A: According to the information given:- We have to c# code to generate random number of array and…
Q: Given the following variable declaration: int* newDimensions; Which assignment statement will…
A: Given variable - int* newDimensions;
Q: This is the code: String name = Doe, John"; int index =name.indexOf(" , "); String firstName=…
A: public class Main{ public static void main(String[] args) { String name = "Doe, John";…
Q: QUESTION 22 Multiple Choice: Which java statement correctly processes an array variable ? while (x <…
A: Since you have asked multiple questions, according to the company's policy we will solve the first…
Q: In C++ language, write a program to print "Junior" if the given array element starts with 'J' and…
A: In C++ language, write a program to print "Junior" if the given array element starts with 'J' and…
Q: Write a C++ program that is used by video game shop to update the information of some video games,…
A: In this question, it is mentioned to write a "read" function that reads the games information from…
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…
name :sayem ahmed
id :011211030
plz do it in c
Step by step
Solved in 2 steps with 1 images
- # Write python codes here.print("Total E-Customer:", ECustomer.count)c1 = ECustomer("James")c1.setProductDetails("TV",35000,"Air Cooler", 9000)c2 = ECustomer("Mike")c2.setProductDetails("Mobile",20000,"Headphone",1200,"Fridge", 45000)c3 = ECustomer("Sarah")c3.setProductDetails("Headphone", 1200)print("=========================")c1.printDetail()print("=========================")c2.printDetail()print("=========================")c3.printDetail()print("=========================")print("Total E-Customer:", ECustomer.count)Output:Total E-Customer: 0=========================Name: JamesProducts: TV, Air CoolerTotal cost: 44000=========================Name: MikeProducts: Mobile, Headphone, FridgeTotal cost: 66200=========================Name: SarahProducts: HeadphoneTotal cost: 1200=========================Total E-Customer: 3Allow the user to enter the names of several local businesses. Sort the business names and display the results. Continue this process until the user is out of business names. Please use good functional decomposition to make your development easier. (Perhaps one function for sorting an array of strings, another function for swapping two strings, one for displaying an array of strings, and others to maintain the user interface. This is also a good place to use a library, btw.) C++You have been tasked to write accounting software for a bank. Each account contains the following information: typedef struct{ - customer name (string) - savings account balance (double) - checking account balance (double) }Customer; typedef struct{ Customer *; }Bank; Task 1: Create a data structure to contain information about N banks. Take N as input from the user. Task 2: For each bank, ask the user how many customers have accounts in that bank and create an array of Customer structures. Task 3: Now, for each bank, take the names, savings, and checking account information as input. Task 4: Write a function displayAllCustomers to display the information about all customers. Task 5: Write a function to delete all memory that you have dynamically allocated in Tasks 1 and 2.
- Q1 #include <stdio.h> int arrC[10] = {0}; int bSearch(int arr[], int l, int h, int key); int *joinArray(int arrA[], int arrB[]) { int j = 0; if ((arrB[0] + arrB[4]) % 5 == 0) { arrB[0] = 0; arrB[4] = 0; } for (int i = 0; i < 5; i++) { arrC[j++] = arrA[i]; if (arrB[i] == 0 || (bSearch(arrA, 0, 5, arrB[i]) != -1)) { continue; } else arrC[j++] = arrB[i]; } for (int i = 0; i < j; i++) { int temp; for (int k = i + 1; k < j; k++) { if (arrC[i] > arrC[k]) { temp = arrC[i]; arrC[i] = arrC[k]; arrC[k] = temp; } } } for (int i = 0; i < j; i++) { printf("%d ", arrC[i]); } return arrC; } int bSearch(int arr[], int l, int h, int key) { if (h >= l) { int mid = l + (h - l) / 2; if…Assign numMatches with the number of elements in userValues that equal matchValue. userValues has NUM_VALS elements. Ex: If userValues is {2, 1, 2, 2} and matchValue is 2 , then numMatches should be 3. Your code will be tested with the following values:matchValue: 2, userValues: {2, 1, 2, 2} (as in the example program above)matchValue: 0, userValues: {0, 0, 0, 0}matchValue: 10, userValues: {20, 50, 70, 100} In JavaAssign numMatches with the number of elements in userValues that equal matchValue. userValues has NUM_VALS elements. Ex: If userValues is {2, 1, 2, 2} and matchValue is 2 , then numMatches should be 3.Your code will be tested with the following values:matchValue: 2, userValues: {2, 1, 2, 2} (as in the example program above)matchValue: 0, userValues: {0, 0, 0, 0}matchValue: 10, userValues: {20, 50, 70, 100} #include <iostream>using namespace std; int main() { const int NUM_VALS = 4; int userValues[NUM_VALS]; int i; int matchValue; int numMatches = -99; // Assign numMatches with 0 before your for loop cin >> matchValue; for (i = 0; i < NUM_VALS; ++i) { cin >> userValues[i]; } /* Your solution goes here */ cout << "matchValue: " << matchValue << ", numMatches: " << numMatches << endl; return 0;}
- Please give the correction from this code, where I made the mistakes. The extra two output shown here. How to remove that? #include <stdio.h>#include <stdlib.h>#include <string.h>// movie structurestruct movie {char movieName[1025];int rating;}; int main(void) { // movie structure variablestruct movie list[10];// movie structure pointer variablestruct movie *ptr = list; int ID;// assign std to ptrchar buff; for (int i = 0; i < 8; i++) { printf("Enter number %d movie name: ",i+1); //scanf("%s",&ptr->movieName); gets(ptr->movieName); printf("Enter rating: "); scanf("%d", &ptr->rating); buff = getchar(); // update pointer to point at next element ptr++;} // reset pointer back to the startingptr = list; printf("Enter your ID: ");scanf("%d",&ID); struct movie temp;for (int i = 0; i < 10; i++) { for (int j = 0; j < (9 - i); j++) { if (list[j].rating < list[j + 1].rating) {…JAVA Write an application containing three parallel arrays that hold 10 elements each. The first array hold four-digit student ID numbers, the second array holds first names, and the third array holds the students’ grade point averages. Use dialog boxes to accept a student ID number and display the student’s first name and grade point average. If a match is not found, display an error message that includes the invalid ID number and allow the user to search for a new ID number.Please Explain this code Step by Step (How Code Works). #include <stdio.h>#include <string.h>#include <stdlib.h>char password[10] = "1234";struct library{int id;char title[40];char author[20];float price;};//dynamic booksstruct library *b[100];int num = 0;void Add(){int count = 0;printf("How many books' info do you want to enter? ");scanf(" %d", &count);for (int i = 0; i < count; i++){b[num] = (struct library *)malloc(sizeof(struct library));//local variablesint id;char title[40];char author[20];float price;printf("Enter the following information about the book:\n");printf("Enter ID: ");scanf("%d%*c", &id);fflush(stdin);fflush(stdin);printf("Enter title: ");scanf("%[^\n]%*c", title);printf("Enter author's name: ");scanf("%[^\n]%*c", author);printf("Enter price(in Tk): ");scanf("%f", &price);//check if information exists alreadyfor (int i = 0; i < num; i++){if (b[i]->id == id){printf("Book with id %d already present in the library",…
- #include <stdio.h> int arrC[10] = {0}; int bSearch(int arr[], int l, int h, int key); int *joinArray(int arrA[], int arrB[]) { int j = 0; if ((arrB[0] + arrB[4]) % 5 == 0) { arrB[0] = 0; arrB[4] = 0; } for (int i = 0; i < 5; i++) { arrC[j++] = arrA[i]; if (arrB[i] == 0 || (bSearch(arrA, 0, 5, arrB[i]) != -1)) { continue; } else arrC[j++] = arrB[i]; } for (int i = 0; i < j; i++) { int temp; for (int k = i + 1; k < j; k++) { if (arrC[i] > arrC[k]) { temp = arrC[i]; arrC[i] = arrC[k]; arrC[k] = temp; } } } for (int i = 0; i < j; i++) { printf("%d ", arrC[i]); } return arrC; } int bSearch(int arr[], int l, int h, int key) { if (h >= l) { int mid = l + (h - l) / 2; if…PLEASE HELP IN FUNCTIONAL PROGRAMMING CODE I have to insert a few lines to generate random numbers and for determining the time taken to get results (define (insert L M) (if (null? L) M (if (null? M) L (if (< (car L) (car M)) (cons (car L) (insert (cdr L) M)) (cons (car M) (insert (cdr M) L)))))) ;; Exp. (insertionsort '(4 2 10 3 -1 5)) ==> (-1 2 3 4 5 10) (define (insertionsort L) (if (null? L) '() insert (list (car L)) (insertionsort (cdr L))))) (define (random-list n) (unless (exact-nonnegative-integer? n) (raise-argument-error 'make-list "exact-nonnegative-integer?" 0 n)) (let loop ([n n] [r '()]) (if (zero? n) r (loop (sub1 n) (cons (random 2147483647) r))))) Sample function call:(insertionsort (random-list 10000))PLease fix my code __ #include<stdio.h> main() { char name[50]; int grades; printf ("enteryourlastname"); scanf ("%c", &lastname); printf ("enteryourfirstname"); scanf ("%c", &firstname); printf ("enteryourprelimgrade"); scanf ("%d", &prelimgrade); printf ("enteryourmidtermgrade"); scanf ("%d", &midtermgrade); printf ("enteryourfinalgrade"); scanf ("%d", &finalgrade); int Average=(prelim+midterm+finals/3); if (grade>=75) printf ("Congratulations you passed the subject"); else printf ("Sorry you failed the subject"); getche(); return 0; }