SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 213 Weeks Ago, 4 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Engineering Posted 15 Oct 2017 My Price 10.00

Is there anyone can help me to write the code for the part 1 of this assignment? Thanks

CSE 240Homework 2 – Programming with CDue: Wednesday, September 6, 11:59 PM1.What This Assignment Is About:•Structures•Functions•Arrays of Primitive Values•Arrays of Structs•Recursion•for and if Statements•Selection Sort2.Use the following Guidelines•Give identifiers semantic meaning and make them easy to read (examples num_students,gross_pay, etc).•Use lower case word for all identifiers (variables, functions, objects). Separate wordswith underscore character•Use tabs or spaces to indent code within blocks (code surrounded by braces). Thisincludes structures, functions, and code associated with ifs, switches and loops. Beconsistent with the number of spaces or tabs that you use to indent.•Use white space to make your program more readable.For each file in your assignment, provide a heading (in comments) which includes:•The assignment number.•Its author (your name).•A description of what this program is doing.3.Part 1. Primitive Types, Searching, Recursion (35 points).a)Create a filehomework_part_1.cb)Create a functioninitialize_arraythat receives two parameters: an array of integers andthe array size. Use a for loop and an if statement to put 0s in the odd positions of thearray and 1s in the even positions.Hint: review pointers as parameters.c)Create a functionprint_arraythat receives as parameters an array of integers and thearray size. Use a for statements to print all the elements in the array.Hint: reviewpointers as parameters.
Background image of page 1
d)Create a functionselection_sortthat receives as parameters an array of integers and thearray size, and order the array element in descending order. Implement Selection Sortalgorithm. It should be Selection Sort, not Bubble Sort, not Quick Sort, etc. If you do notremember selection sort, this link could be useful:https://goo.gl/hrAdMoe)Create a recursive function that calculate and returns thefactorialof a number. Thefunction receives the number (integer number) as parameterf)Copy the following main function in your class,int main() {int a [10] = {3, 5, 6, 8, 12, 13, 16, 17, 18, 20};int b [6]= {18, 16, 19, 3 ,14, 6};int c [5]= {5, 2, 4, 3, 1};// testing initialize_arrayprint_array(a, 10); // print: 3, 5, 6, 8, 12, 13, 16, 17, 18, 20initialize_array(a, 10);print_array(a, 10); // print: 1, 0, 1, 0, 1, 0, 1, 0, 1, 0// testing initialize_arrayprint_array(b, 6); // print: 18, 16, 19, 3 ,14, 6selection_sort (b, 6);print_array(b, 6); // print: 19, 18, 16, 14, 6, 3// testing factorialprintf("Factorail of 5 - %d\n", factorial (5)); //print: 120c[0] = factorial (c[0]);c[1] = factorial (c[2]);print_array(c, 5); // print: 120, 24, 4, 3, 1return 0;}Grading Criteria for the part 101 pts: file contains header information01 pts: adequate comment to explain every function01 pts: consistent indentation and spacing08 pts: selectionSort08 pts: printArray08 pts: initializeArray08 pts: factorial
Background image of page 2

Attachments:

Answers