#include <stdio.h>int main(){int d;int s[20],i, j, p, lg=0,m,t=0;char c;printf("Enter number of sale: ");scanf("%d", &d);for(i=0; i<d; i++){ printf("\n sales %d sales: ",i+1);scanf("%d", &s[i]);}for(i=0; i<d; i++){for(j=i+1; j<d; j++){if(s[i] > s[j]){p= s[i];s[i] = s[j];s[j] = p;}}}printf("\n sales lowest to highest: ");for(i=0; i<d; i++){printf("\nsales %d ", s[i]);}printf("\n highest: %d ",t);getch();} it should be: highest : 2000
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: 1. Write a readEmployee function that takes a pointer to an employee struct and fills in the…
A: #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int…
Q: thon Geography Grades 2 Make a copy of your program for the problem Geography Grades 1 and change…
A: It is defined as an interpreted, object-oriented, high-level programming language with dynamic…
Q: 4.main(){ int i,j; long int f=1; for (i=1, i< 10; i++) f=f*i; } prinf(“%ld",f);}
A: Factorial Program in C: Factorial of n is the product of all positive descending integers. Factorial…
Q: #include int main() int i=7; do for(int j=7;j4);
A: Here, Code is given to trace.
Q: def get_volume (width, height, length=2): volume = width * height * length return volume def main…
A: def get_volume (width , height , length=2): volume = width * height *length return…
Q: CodeWorkout Gym Course Search exercises... Q Search kol X459: Review Fibonacci In mathematics, the…
A: Given: To write a recursive function that returns nth fibonacci number:
Q: Write a program that lets the user enter the loan amount and loan period in number of years and…
A: Please find the answer below :
Q: void Q1_1() { const int SIZE = 22; char value[] = {'ce','e', 'E', 'p', '1', 'u','s', 'P', 'L', 'U',…
A: #include <iostream> using namespace std; void Q1_1(){const int SIZE = 22; // Declaring and…
Q: Dry run the following code. You have to complete the iterations and fill the table: #include using…
A: Given that m and n values are 10, in a single loop, using two indices, if the addition of two index…
Q: Although it will no longer be used, please leave the earlier global variable with the initialized…
A: Memory Layout of C Programs A typical memory representation of a C program consists of the…
Q: Void main ) { int i-3, j-5,K=8; ans Choose the correct A The result f the ollowing program is #…
A: Here we have variable declared as i=3, j=5, k=8 Then we call function M() and pass value of i, j, k…
Q: Question: Write a function to display a pattern as follows: 1 2 1 ... ... n n-1…
A: Solution:The python program has the following algorithm:In the displayPattern() function,Declare and…
Q: #include using namespace std; const int y = 1; int main () ( int static y - 2; int i = 3, j - 4, m…
A: The output along with the explanation is given below:
Q: Write a program that reads students’ names followed by their test scores. The program should output…
A: The complete code is given below with comments.
Q: i. The number of distinct combinations of n objects, taken rat a time, is determined by the…
A: I give the code in Java along with output and code screenshot
Q: /I need help debugging the C code below the image is what I was following for directions while doing…
A: The Above Code is Debug Success full:
Q: In C++ Declare a constant “ SIZE = 5 ” Declare an array of ints , of size SIZE . Initialize that…
A: code :-- #include <iostream>// define constant named SIZE equal to 5 #define SIZE 5using…
Q: Dry run the following code. You have to complete the iterations and fill the table: #include…
A: Given question has asked to dry run the following code and to complete the iterations and fill the…
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: 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: void func(int&, int& b, float& ) { cout > a; // enter e cout > b; // enter 1
A: Please find the answer below :
Q: Bulgarian solitaire def bulgarian_solitaire(piles, k): You are given a row of piles of pebbles,…
A:
Q: for(int 1 = 0; 1 < 5; i++){ for(int j = 0; j < 5; j++){ cout << (i + j) % 2; } cout << endl; }
A: Task : Given the code segment. The task is to find the output of the code.
Q: 1. 2. void main (O { int main ( ) { string stl="road ",st2="Trip",st3; st2=st3+st1; cout<<st3…
A: PART 1:- The output will be:- 0 22 5 74 Explanation:- The operation performed is of printing the…
Q: i. Void search(int * m[],int x) { } void search(int * m, int x) ii. {
A: Given code is 1) Void search (int * m[],int x) { } 2) void search (int*m,int x) { }
Q: Letter Grades Write a program in C++ that translates a letter grade into a number grade. Letter…
A: 1. take input from user. i.e. the letter grade.2. initialize a variable named grade;3. if the input…
Q: EXPLAIN THIS CODE EACH LINE #include #include int main() { char name[20]; int…
A:
Q: (** Here is my issue I need help on how I can put a repetition in. For example I choose case 1,then…
A: Question given: A program code is given. Remove all errors and make it correct that it responds…
Q: Design program performs föllow 1. Read your student number on the command line when you call the…
A: It is defined as a powerful general-purpose programming language. It can be used to develop software…
Q: #include 2 #include int main(void) { srand(time(@)); int arr[100]; int sum = 0; 4 6 7 %3D for(int…
A: just see the below code C program convert to RISCV assembly
Q: void minimum (int i1, int i2) { if (i1 > n >> m; minimum (n, m); return 0; }
A: .file "p.cpp" .text .section .rdata,"dr" _ZStL19piecewise_construct:…
Q: Code in PHP. RULE: Cannot use array and functions !!! User can show all of the data entered from the…
A: The above functionality can be achieved by storing the first name and last name in a variable and…
Q: python nMath: pentagonal numbers) A pentagonal number is defined as n(3n-1)/2 for n=1,2,..., and so…
A: Declare a count variable that is used to display the first 10 numbers in each line. Using for loop,…
Q: #include int main() { int i=7; do { for(int j=7;j4); return 0;
A: Here, Code is given to tracing.
Q: 3.6 LAB: Number pattern Write a recursive function called print_num_pattern() to output the…
A: def print_num_pattern(num1, num2): if num1 <=0: print("0", end=" ") # If first number…
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: public static int isOdd(int x). This function returns 1 if the number is odd, and 0 if it is even.…
A: public static int isOdd(int x). This function returns 1 if the number is odd, and 0 if it is even.…
Q: This expands the previous work to enable handling multiple employees. You will do this by…
A: #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int…
Q: LAB: Number pattern Write a recursive function called print_num_pattern() to output the following…
A: Python code with given test case and output in detail below.
Q: the longest sequence of increasing numbers. Use the function: void longestSeq
A: Below the C program for the longest sequence of increasing numbers
Q: #include int main() { int i=7; do for(int j=7;j4); return 0;
A: Here, Program is given to tracing.
Q: int main(int argc, char **argv) { float *rainfall; float rain_today; // rainfall has been…
A: Here is the answer:-
Q: c++complete and change #include using namespace std; int sumbyrow(int* m, int ncol, int row) {…
A: Note : I am considering that you are facing some logical error in this code which is not…
Q: need help debugging the C code below the image is what I was following for directions while doing…
A: // creating the pointer struct employees *emp = malloc(sizeof(struct employees)); //…
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: python Geography Grades 3 Make a copy of your program for the problem Geography Grades 2 and change…
A: Answer: I have done in python also I have attached python code .
Q: I (Assign grades) Write a program that reads a list of scores and then assigns grades based on the…
A: class grade_calculator: def __init__(self): self.__marks_obtained = []…
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…
#include <stdio.h>
int main(){
int d;
int s[20],i, j, p, lg=0,m,t=0;
char c;
printf("Enter number of sale: ");
scanf("%d", &d);
for(i=0; i<d; i++){
printf("\n sales %d sales: ",i+1);
scanf("%d", &s[i]);
}
for(i=0; i<d; i++){
for(j=i+1; j<d; j++){
if(s[i] > s[j]){
p= s[i];
s[i] = s[j];
s[j] = p;
}
}
}
printf("\n sales lowest to highest: ");
for(i=0; i<d; i++){
printf("\nsales %d ", s[i]);
}
printf("\n highest: %d ",t);
getch();
}
it should be:
highest : 2000
Step by step
Solved in 3 steps with 1 images
- (Numerical) Write and test a function that returns the position of the largest and smallest values in an array of double-precision numbers.5: CheckLetter.cpp) Write a program that adds a checkletter to an eight-digit number. The check letter should becomputed as follows: Break the number up into 4 two-digitnumbers. Add the four numbers together. Find theremainder after division by 26. The check letter is the letterin the alphabet that corresponds to the number justcomputed. (A=0, B=1, C=2, etc.) Print the original numberfollowed by the check letter. Use at least one ffunction thatreturns a value when you write this program.Programming Exercise 10 in Chapter 6 asks you find the mean and standard deviation of five numbers. Extend this programming exercise to find the mean and standard deviation of up to 100 numbers. Suppose that the mean (average) of n numbers x1, x2, . . ., xn is x. Then the standard deviation of these numbers is:S=sqrt(((x1-x)^2+(x2-x)^2+...+(xi-x)^2+...+(xn-x)^2)/n)
- pls debug this pseudocode // A high school is holding a recycling competition,// and this program allows a user to enter a student's // year in school (1 through 4) and number of cans collected// for recycling. Data is entered continuously until the user// enters 9 for the year.// After headings, output is four lines --// one for each school year class.start Declarations num year num cans num SIZE = 4 num QUIT = 9 num collectedArray[SIZE] = 0, 0, 0 string HEAD1 = "Can Recycling Report" string HEAD2 = "Year Cans Collected" output "Enter year of student or ", QUIT, " to quit " input year while year <> QUIT output "Enter number of cans collected " input cans collectedArray[year] = collectedArray[year] + cans output "Enter year of student or ", QUIT, " to quit " input year endwhile output HEAD1 output HEAD2 year = 1 while year < SIZE output year, collectedArray[year] year = year + 1…C++ PROGRAMMING PART C Please help me i am stressing so much on this. I would really appreciate it. THIS was the code provided to me to help me solve the question. const int N =31; // N parking spaces bool parking[N]; // the garage void EmptyTheLot(bool parking[], int N) { for(int i=0; i<N; i++) p[i]=false; // empty space } // returns -1 if no space found, //otherwise it returns 0<=i<N for a valid space. int FindSpace(int PlateNumber, bool parking[], int N) { // ????? } main() { EmptyTheLot(parking, N); // start with an empty parking garage. // get plate numbers and fill lot. }Question Write a program to create an answer sheet to read the student’s answers for a ten (10) item exam. It should then display a message indicating the score and remarks whether the student passed or failed the exam. (A student must correctly answer 6 of the 10 questions to pass the exam.) Here are the correct answers (key to correction), which should be initialized and stored in an array: TRUE FALSE TRUE FALSE FALSE FALSE TRUE TRUE TRUE FALSE What I need is a C++ program and must use array of strings.
- Bulgarian solitaire def bulgarian_solitaire(piles, k): You are given a row of piles of pebbles, all identical, and a positive integer k so that the total number of pebbles in these piles equals k*(k+1)//2, the arithmetic sum formula that equals the sum of positive integers from 1 to k. Almost as if intended as a metaphor for the bleak daily life behind the Iron Curtain, all pebbles are identical and you don't have any choice in your moves. Each move picks up one pebble from each pile (even if doing so makes that pile vanish), and creates a new pile from the resulting handful. For example, starting with[7, 4, 2, 1, 1], the first move turns this into [6, 3, 1, 5]. The next move turns that into [5, 2, 4, 4], which then turns into the five-pile configuration [4, 1, 3, 3, 4], and so on. This function should count how many moves are needed to convert the given initial piles into the goal state where each number from 1 to k appears as the size of exactly one pile, and return that count. These…(Java) The greatest common divisor of two positive whole numbers and n1 and n2 is the largest number g such that g evenly divided into both n1 and n2. Write a complete program that takes two positive whole numbers from the user and displays the common divisor.Order check Write a program OrderCheck.java that takes four int command-line arguments w, x, y, and z. Define a boolean variable whose value is true if the four values are either in strictly ascending order (w < x < y < z) or strictly descending order (w > x > y > z), and false otherwise. Then, display the boolean variable value.
- c++ coding language I need help with part B and C please. If you are unable to do both, then PLEASE prioritize part C. I am really stuck and really can use the help. This is the code for c that was provided in order to guide me: const int N =31; // N parking spaces bool parking[N]; // the garage void EmptyTheLot(bool parking[], int N) { for(int i=0; i<N; i++) p[i]=false; // empty space } // returns -1 if no space found, //otherwise it returns 0<=i<N for a valid space. int FindSpace(int PlateNumber, bool parking[], int N) { // ????? } main() { EmptyTheLot(parking, N); // start with an empty parking garage. // get plate numbers and fill lot. }(Initialize array) Write a function called initializeArray that receives an array, its size, and two integers and initializes the array with random values between the first integer and the second integer. Write another function called printArray that receives an array and its size and prints the array elements in a column. Write a test program that declares and initializes an array of size 20 with random values between 0 and 10 inclusive, and then prints the array using the above functions Write a C++ program that declares and initializes an integer array of size 100 with random integers between 1 and 10 inclusive using initializeArray (from question 1) and counts the occurrence of each number in the array and graphs the information in the form of a bar chart or histogram—each number is printed, then a bar consisting of that many asterisks is printed beside the number. Here is a sample run of the program: Number Value Histogram 1…(Initialize array) Write a function called initializeArray that receives an array, its size, and two integers and initializes the array with random values between the first integer and the second integer. Write another function called printArray that receives an array and its size and prints the array elements in a column. Write a test program that declares and initializes an array of size 20 with random values between 0 and 10 inclusive, and then prints the array using the above functions Write a C++ program that declares and initializes an integer array of size 100 with random integers between 1 and 10 using initializeArray (from question 1) and counts the occurrence of each number in the array and prints the occurrences. Note: Print time or times correctly. Hint: Declare another array called count that stores the number of each value as you count the numbers of the original array. Use printArray (from question 1) to print the values of count. Here is a sample run of the program: 1…