PRACTICE EPP MIDTERM Write all code in the same source files: yourname_practicem
ID: 3733530 • Letter: P
Question
PRACTICE EPP MIDTERM Write all code in the same source files: yourname_practicemidterm.cpp / .h PART I Eunction that finds the s double sum(double* array, size_t n); 2. write a string function that determines if a string is a valid variable name in C++/C. Recall that valid names are only alphanumeric (A-20-9)except the first character cannot be a digit: bool isValidName (const char* s) 3. Write a single-linked list from scratch, having the following structs/classes: struct data /7 your code here struct node t g class linkedlist I/ your code here /1 your code hereExplanation / Answer
I habe answered Q1.
Please repost others in separate post.
double sum(double* array, size_t n) {
// base case
if(n == 1){
return array[0];
}
return array[n-1] + sum(array, n-1); // recursive call
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.