New Perspectives On Html5, Css3, And Javascript, Loose-leaf Version
6th Edition
ISBN: 9781337685764
Author: Patrick M. Carey
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 11.3, Problem 1QC
Provide the general code to create a function named showReport() using the function declaration format.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
I need a C code of this.
Instructions:
In the code editor, you are provided with an initial code in the main() that asks the user for the elements of a 5x5 2D array and a call to a function called flex2D(). Do not edit anything in the main() function.
Your task is to implement the function definition of the flex2D() with the following details:
Return type - void
Function name - flex2D
Parameters - int[][5]
Definition - prints the elements of each of the row twice.
Input
1. Elements of a 5x5 2D array
#include<stdio.h>
void flex2D(int[][5]);
int main(void) { int matrix[5][5];
printf("Enter the elements:\n"); for(int row = 0; row < 5; row++) { for(int col = 0; col < 5; col++) { scanf("%d", &matrix[row][col]); } }
printf("\nFlex:\n");
flex2D(matrix);
return 0;}
// TODO: Implement the function definitionvoid flex2D(int arr[][5]) {
}
Output should be integers like this:
Enter·the·elements:
1·9·2·3·4
8·2·4·0·1…
I need a C code of this ASAP please.
Instructions:
In the code editor, you are provided with the definition of a struct Dog. This struct needs a character value for its gender, which could either be 'm' for a male Dog or 'f' for a female Dog.
Furthermore, an array of Dogs has already been created an each of their genders has been set. Then, on line 16, a call to the function giveDogs() was made where the dogs array was passed.
Your task is to implement this giveDogs() function which has the following details:
Return type - void
Name - giveDogs
Parameters
a pointer/holder of a Dogs array
size of the Dogs array
Description - loops through the Dogs array and prints the correct message (refer to the sample output)
Main code:
#include<stdio.h>
typedef struct { char gender;} Dog;
void giveDogs(Dog*, int);
int main(void) { Dog dogs[100];
for(int i = 0; i < 100; i++) { dogs[i].gender = i % 2 == 0 ? 'm' : 'f'; }
giveDogs(dogs, 100);
return 0;}…
I need the answer as soon as possible
Chapter 11 Solutions
New Perspectives On Html5, Css3, And Javascript, Loose-leaf Version
Ch. 11.1 - Prob. 1QCCh. 11.1 - Prob. 2QCCh. 11.3 - Provide the general code to create a function...Ch. 11.3 - Prob. 2QCCh. 11 - Prob. 1RACh. 11 - Prob. 2RACh. 11 - Prob. 3RACh. 11 - Prob. 4RACh. 11 - Prob. 5RACh. 11 - Prob. 6RA
Ch. 11 - Prob. 7RACh. 11 - Prob. 8RACh. 11 - Prob. 9RACh. 11 - Prob. 10RACh. 11 - Prob. 11RACh. 11 - Prob. 1CP1Ch. 11 - Prob. 2CP1Ch. 11 - Prob. 3CP1Ch. 11 - Prob. 4CP1Ch. 11 - Prob. 5CP1Ch. 11 - Prob. 6CP1Ch. 11 - Prob. 7CP1Ch. 11 - Prob. 8CP1Ch. 11 - Prob. 9CP1Ch. 11 - Prob. 2CP2Ch. 11 - Prob. 3CP2Ch. 11 - Prob. 5CP2Ch. 11 - Prob. 2CP3Ch. 11 - Prob. 3CP3Ch. 11 - Prob. 1CP4Ch. 11 - Prob. 2CP4Ch. 11 - Prob. 3CP4Ch. 11 - Prob. 4CP4Ch. 11 - Prob. 5CP4Ch. 11 - Prob. 6CP4Ch. 11 - Prob. 7CP4
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- I need help writing a C++ code. I need help writing a that dynamically allocates an array enough to hold a user-defined number of test scores. Once all the scores are entered the array needs to be passed to a function that sorts them in ascending order. Another function should be called that calculates the average scores. Finally, the program should display the sorted list of scores sorted from ascending to descending and averages them with proper headings. Please use a use pointer rather than an array notationion. also please don't allow negative scores.arrow_forwardThere are two parts to this assignment. Part 1) Submit the three function prototypes (ReadInputRecord, CalculateScore, and WriteOutputRecord) and corresponding stub functions that you plan to use for the assignment. You should put some thought into your function prototypes, because you will not be able to change them once I have approved them.arrow_forward‘Write a function has_unique_values() that takes a dict as a parameter and returns True if the keys have unique values (that is not two keys have the samevalues) Write several assertion to test this function.arrow_forward
- Write a function called normalizeArray. Your function should accept a reference to a C++11 style std:array containing 3 double values. Your function should then normalize the array such that the sum of all the elements is 1. Your function should use an iterator to work through the array – first to calculate the sum of all the elements and then to modify the value of each element in the normalization process. Write a driver program to test your function.arrow_forward/* Lecture 14: Arrays aS Function Parameters Date: 10/22/2021 Author: Sareh Taebi */ #include #define SIZE 50 // prototyping functions void fill array(int list[], int n, int in_value); int main() { int x [SIZE] = {0}; //computer needs to know about array type, number of elements and its name (address of the array) //call to a function that initializes all array fill_array (x, 7, 777); elements to 1 //print array elements for (int i = 0; i< SIZE ; i++) printf("%d\n", x[i]); return 0; //function definition comes after the main function /* fills any aray to an input value set by in_value parameter Pre: array list, size of array, input value */ void fill_array(int list[], int n, int in_value) { int i; for (i = 0; i< n ; i++) iist [i] in_value;arrow_forward7. using c++, Write a void function that accepts an integer array a and a integer SizeA, and an integer n, and adds n to every element in that array. Be sure to develop an appropriate name for your function.arrow_forward
- Create a function that takes an argument by value as a const; then try to change that argument in the function body. Please submit your code in C++.arrow_forwardWhat is the purpose of the manipulator setprecision? Which header file must be included to use the function setprecision?arrow_forwardPlease complete the exercise according to the instructions. Thank you!arrow_forward
- This is an computer programming question The code should be in C++ language Define an enumeration type, triangleType, that has the values scalene,isosceles and equilateral.Write a function, triangleShape, that takes as parameters three numbers,each of which represents the length of a side of the triangle. The function should return the shape of the triangle. (Note: In a triangle, the sum of the lengths of any two sides is greater than the length of the third side.)Write a program that prompts the user to input the length of the sides of a triangle and outputs the shape of the triangle.arrow_forwarda c++ program for a (cafe system) that includes this specifications: -Functions (should include both: pass by value and pass by reference variables, void function and unction returning any value) - Array of structs (at least one single array of struct) - Selection and repetition structures as needed - Add your team members names as a comment in the first line of your program - You should print a menu to the user and offer him/her different services. - Main Services: 1-adding new item. 2-search for specific item. 3-update existing record. 4-delete. 5-Sort. 6-Display. 7-At the start, your program should populate the array(s) from a file and allow the user to edit it. At the end overwrite the same file with the latest contents of the array(s). 8-Provide another statistical report as separate text file e.g. the number of records, with date, time of last update. - The program should continue running until the user chooses to exit it. - Ensure to avoid any errors of any type (Run-time error,…arrow_forwardRedefined Outer Name 1 When writing code inside an inner block (such as within a function definition), care must be taken so as to not redefine variables from the outside the block that are still in use. The code below uses a name from an outer block (the function name) in an inner block (the function body). Submit the provided code and click on the "Expand for Detailed Error Message" dropdown to determine where the Redefined Outer Name error occurs. Then, make changes to the starter code to resolve the error. 1 def total_apples (apples_per_tree: int, trees: int) - 3 4 5 6 co 00 8 9 ### ""Return the total number of apples in an apple the number of trees and the number of apples per tree. >>> total_apples (4,7) 28 ### int: orchard given total_apples = apples_per_tree * trees return total_applesarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- New Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
What Are Data Types?; Author: Jabrils;https://www.youtube.com/watch?v=A37-3lflh8I;License: Standard YouTube License, CC-BY
Data Types; Author: CS50;https://www.youtube.com/watch?v=Fc9htmvVZ9U;License: Standard Youtube License