SlideShare a Scribd company logo
Your 1ab8. c file is doe by Friday, 11.59pm, to be submitted on Gradescope. Overview This week,
you will start with last week's program and create your own functions for some of the tasks. You'll
have a printmenu () function, printarray () function and a convertcase () function. Just like you saw
in class, the code from the main () function that performs each of those tasks will be moved from
the the main () function and into their respective functions. More details about those functions are
shown below in the Lab Assignment section. All the functions will be in one file, called lab8.c.
Background Information For this lab, you will use last week's program to start with. Copy it and
rename it lab8.c. Again, you will be adding more code to this program in the future, so make sure
you get this one working. Functions and Reminders 1. As you saw in class, functions perform
(usually) one task, or a couple of smaller tasks that combined perform a task. 2. Some functions
return a value (the retum type being specified in the functon header/signature and a return
statement at the bottom of the function): int printmenu() & and some functions do not return any
value (the retum type then being specified as void and no return statement at the bottom of the
function): void convertCase (char text [MAX_LINE] [MAX_LINE_LEN] ) i 3. When arguments are
being sent to the function, the function then has "parameters" specified in the function
header/signature. The parameters that are specified indicate the type and the name: void
printarray (char text[MAX_LINE] [MAX_LINE_LEN], int size) { If a function is not being sent any
arguments, then the parameter list will be empty (meaning nothing in the parentheses). int
printMenu() f / / empty parentheses 4. When sending a 1-D array to a function, the parameter can
be specified with empty square brackets: int findLowest (int theArray[], int size) f // from in-class
exercise When a 2-D array is sent to a function, however, the parameter has to at least specify the
number of columns. So the parameter can be specified as: void f1 (int array [][12]) If a variable is
being used for the dimension(s) of the array, then the variable must appear first in the list of
parameters: void 11 (int numRows, int numCols, int array 1 [numRows] [numCols]) For this lab,
since the number of rows and number of columns are either idefine or constants, defined outside
of the main0 function, the parameter showing the array can use those names for the dimensions
without including them in the parameter list: void convertCase (char text[MAX_LINE]
[MAX_LINE_LEN]) I 5. As discussed in class, to eliminate chances of confusion, you should
ensure that there is no variable shadowing (the argument being sent to the function has a different
name than the parameter). 6. Function prototypes should be at the top of the file, EVFN IF THE
MAINO FUNCTION IS AT THE BOTTOM OF5. Function prototypes should be at the top of the file,
EVEN If THE MANNO FUNCTION IS AT THE BOTTOM OF THE FILE. So the top of your file
should consist of the header comment, Hinclude statements, /define statements or constant
variables (if any), structure definitions (if any), prototypes - and then functions. 7. Function bodies
should be preceded with a comment explaining what the function does, as well as what the
inputs/outputs are: / prints a menu to the user parameters: none return: the menu choice that the
user enters int printMenu() 1 /I rest of function code . Lab Assignment For this week's lab8.c
program, you will start with last week's program and create your own functions for some of the
tasks. You will move code from the main () function into the following functions that you will create:
printmenu (), printarray (), and convertcase () functions. The prototypes and information for the
three functions that you will create are shown here: int printmenu(); This function will print the
menu to the user, enforcing valid input, and retum back to the main () function the user's choice.
void printarray (char text [MAX_LINE] (MAX_LINE_LEN], int size), This function will print the
contents of the array sent to it. It also has a second parameter representing the number of lines in
the array. This function does not retum anything. void convertCase (char text [MAX_LINE]
(MAX_LINE_LEN]); This function will convert the case of the chancters in the array sent to it. This
function does not retum anvthing

More Related Content

Similar to Your 1ab8 c file is doe by Friday 1159pm to be submitted.pdf

Functions in C++
Functions in C++Functions in C++
Functions in C++
home
 
Functions
Functions Functions
Functions
Dr.Subha Krishna
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
home
 
Functions assignment
Functions assignmentFunctions assignment
Functions assignment
Ahmad Kamal
 
User Defined Functions
User Defined FunctionsUser Defined Functions
User Defined Functions
Praveen M Jigajinni
 
Maxbox starter
Maxbox starterMaxbox starter
Maxbox starter
Max Kleiner
 
Chapter Functions for grade 12 computer Science
Chapter Functions for grade 12 computer ScienceChapter Functions for grade 12 computer Science
Chapter Functions for grade 12 computer Science
KrithikaTM
 
Functions-Computer programming
Functions-Computer programmingFunctions-Computer programming
Functions-Computer programming
nmahi96
 
Dti2143 chapter 5
Dti2143 chapter 5Dti2143 chapter 5
Dti2143 chapter 5alish sha
 
C functions list
C functions listC functions list
Chapter 1.ppt
Chapter 1.pptChapter 1.ppt
Chapter 1.ppt
ethiouniverse
 
Lecture 11 - Functions
Lecture 11 - FunctionsLecture 11 - Functions
Lecture 11 - Functions
Md. Imran Hossain Showrov
 
[ITP - Lecture 12] Functions in C/C++
[ITP - Lecture 12] Functions in C/C++[ITP - Lecture 12] Functions in C/C++
[ITP - Lecture 12] Functions in C/C++
Muhammad Hammad Waseem
 
Functions
FunctionsFunctions
Functions
zeeshan841
 
Python Objects
Python ObjectsPython Objects
Python Objects
MuhammadBakri13
 
functions.pptx
functions.pptxfunctions.pptx
functions.pptx
KavithaChekuri3
 
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdfUSER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
SowmyaJyothi3
 
arrays.ppt
arrays.pptarrays.ppt
arrays.ppt
Bharath904863
 
CH.4FUNCTIONS IN C_FYBSC(CS).pptx
CH.4FUNCTIONS IN C_FYBSC(CS).pptxCH.4FUNCTIONS IN C_FYBSC(CS).pptx
CH.4FUNCTIONS IN C_FYBSC(CS).pptx
SangeetaBorde3
 

Similar to Your 1ab8 c file is doe by Friday 1159pm to be submitted.pdf (20)

Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Functions
Functions Functions
Functions
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Functions assignment
Functions assignmentFunctions assignment
Functions assignment
 
User Defined Functions
User Defined FunctionsUser Defined Functions
User Defined Functions
 
Maxbox starter
Maxbox starterMaxbox starter
Maxbox starter
 
Chapter Functions for grade 12 computer Science
Chapter Functions for grade 12 computer ScienceChapter Functions for grade 12 computer Science
Chapter Functions for grade 12 computer Science
 
Functions-Computer programming
Functions-Computer programmingFunctions-Computer programming
Functions-Computer programming
 
Dti2143 chapter 5
Dti2143 chapter 5Dti2143 chapter 5
Dti2143 chapter 5
 
C functions list
C functions listC functions list
C functions list
 
Ch4 functions
Ch4 functionsCh4 functions
Ch4 functions
 
Chapter 1.ppt
Chapter 1.pptChapter 1.ppt
Chapter 1.ppt
 
Lecture 11 - Functions
Lecture 11 - FunctionsLecture 11 - Functions
Lecture 11 - Functions
 
[ITP - Lecture 12] Functions in C/C++
[ITP - Lecture 12] Functions in C/C++[ITP - Lecture 12] Functions in C/C++
[ITP - Lecture 12] Functions in C/C++
 
Functions
FunctionsFunctions
Functions
 
Python Objects
Python ObjectsPython Objects
Python Objects
 
functions.pptx
functions.pptxfunctions.pptx
functions.pptx
 
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdfUSER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
 
arrays.ppt
arrays.pptarrays.ppt
arrays.ppt
 
CH.4FUNCTIONS IN C_FYBSC(CS).pptx
CH.4FUNCTIONS IN C_FYBSC(CS).pptxCH.4FUNCTIONS IN C_FYBSC(CS).pptx
CH.4FUNCTIONS IN C_FYBSC(CS).pptx
 

More from abhijitmaskey

ZZZZ Bestin hikayesi agzllk ve cretkarlktr Bu bedeli.pdf
ZZZZ Bestin hikayesi agzllk ve cretkarlktr Bu bedeli.pdfZZZZ Bestin hikayesi agzllk ve cretkarlktr Bu bedeli.pdf
ZZZZ Bestin hikayesi agzllk ve cretkarlktr Bu bedeli.pdf
abhijitmaskey
 
Zion has 158 shares of company LMN stock LMN issued dividen.pdf
Zion has 158 shares of company LMN stock LMN issued dividen.pdfZion has 158 shares of company LMN stock LMN issued dividen.pdf
Zion has 158 shares of company LMN stock LMN issued dividen.pdf
abhijitmaskey
 
zozimler iin aadakilerden hangisi doru deildir A Metabol.pdf
zozimler iin aadakilerden hangisi doru deildir  A Metabol.pdfzozimler iin aadakilerden hangisi doru deildir  A Metabol.pdf
zozimler iin aadakilerden hangisi doru deildir A Metabol.pdf
abhijitmaskey
 
Zion has 134 shares of company LMN stock LMN issued dividen.pdf
Zion has 134 shares of company LMN stock LMN issued dividen.pdfZion has 134 shares of company LMN stock LMN issued dividen.pdf
Zion has 134 shares of company LMN stock LMN issued dividen.pdf
abhijitmaskey
 
zerk harcama unlar ierir A yatrm mallar iin devlet .pdf
zerk harcama unlar ierir  A  yatrm mallar iin devlet .pdfzerk harcama unlar ierir  A  yatrm mallar iin devlet .pdf
zerk harcama unlar ierir A yatrm mallar iin devlet .pdf
abhijitmaskey
 
Yuki is a fouryearold female growing up in a twoparent fa.pdf
Yuki is a fouryearold female growing up in a twoparent fa.pdfYuki is a fouryearold female growing up in a twoparent fa.pdf
Yuki is a fouryearold female growing up in a twoparent fa.pdf
abhijitmaskey
 
Youstidy wid flewers and havn been werking on a particular a.pdf
Youstidy wid flewers and havn been werking on a particular a.pdfYoustidy wid flewers and havn been werking on a particular a.pdf
Youstidy wid flewers and havn been werking on a particular a.pdf
abhijitmaskey
 
Your team has been contracted to organize and coordinate a n.pdf
Your team has been contracted to organize and coordinate a n.pdfYour team has been contracted to organize and coordinate a n.pdf
Your team has been contracted to organize and coordinate a n.pdf
abhijitmaskey
 
Yzme kesesi olmayan veya yzme kesesi olan ancak hibir eki.pdf
Yzme kesesi olmayan veya yzme kesesi olan ancak hibir eki.pdfYzme kesesi olmayan veya yzme kesesi olan ancak hibir eki.pdf
Yzme kesesi olmayan veya yzme kesesi olan ancak hibir eki.pdf
abhijitmaskey
 
Your group which needs a company name is currently embroil.pdf
Your group which needs a company name is currently embroil.pdfYour group which needs a company name is currently embroil.pdf
Your group which needs a company name is currently embroil.pdf
abhijitmaskey
 
your in text citations c Describe your own MBTI results an.pdf
your in text citations c Describe your own MBTI results an.pdfyour in text citations c Describe your own MBTI results an.pdf
your in text citations c Describe your own MBTI results an.pdf
abhijitmaskey
 
Youll need to do a review of the article given below Your .pdf
Youll need to do a review of the article given below Your .pdfYoull need to do a review of the article given below Your .pdf
Youll need to do a review of the article given below Your .pdf
abhijitmaskey
 
Your analysis should comprise the following Score on each.pdf
Your analysis should comprise the following  Score on each.pdfYour analysis should comprise the following  Score on each.pdf
Your analysis should comprise the following Score on each.pdf
abhijitmaskey
 
You work for portable computers which is a distributor of c.pdf
You work for portable computers which is a distributor of c.pdfYou work for portable computers which is a distributor of c.pdf
You work for portable computers which is a distributor of c.pdf
abhijitmaskey
 
You only have to select one form of SPECIATION to explain an.pdf
You only have to select one form of SPECIATION to explain an.pdfYou only have to select one form of SPECIATION to explain an.pdf
You only have to select one form of SPECIATION to explain an.pdf
abhijitmaskey
 
you will assume the perspective of a conflict theorist What.pdf
you will assume the perspective of a conflict theorist What.pdfyou will assume the perspective of a conflict theorist What.pdf
you will assume the perspective of a conflict theorist What.pdf
abhijitmaskey
 
You have been granted an interview with Texass governor reg.pdf
You have been granted an interview with Texass governor reg.pdfYou have been granted an interview with Texass governor reg.pdf
You have been granted an interview with Texass governor reg.pdf
abhijitmaskey
 

More from abhijitmaskey (17)

ZZZZ Bestin hikayesi agzllk ve cretkarlktr Bu bedeli.pdf
ZZZZ Bestin hikayesi agzllk ve cretkarlktr Bu bedeli.pdfZZZZ Bestin hikayesi agzllk ve cretkarlktr Bu bedeli.pdf
ZZZZ Bestin hikayesi agzllk ve cretkarlktr Bu bedeli.pdf
 
Zion has 158 shares of company LMN stock LMN issued dividen.pdf
Zion has 158 shares of company LMN stock LMN issued dividen.pdfZion has 158 shares of company LMN stock LMN issued dividen.pdf
Zion has 158 shares of company LMN stock LMN issued dividen.pdf
 
zozimler iin aadakilerden hangisi doru deildir A Metabol.pdf
zozimler iin aadakilerden hangisi doru deildir  A Metabol.pdfzozimler iin aadakilerden hangisi doru deildir  A Metabol.pdf
zozimler iin aadakilerden hangisi doru deildir A Metabol.pdf
 
Zion has 134 shares of company LMN stock LMN issued dividen.pdf
Zion has 134 shares of company LMN stock LMN issued dividen.pdfZion has 134 shares of company LMN stock LMN issued dividen.pdf
Zion has 134 shares of company LMN stock LMN issued dividen.pdf
 
zerk harcama unlar ierir A yatrm mallar iin devlet .pdf
zerk harcama unlar ierir  A  yatrm mallar iin devlet .pdfzerk harcama unlar ierir  A  yatrm mallar iin devlet .pdf
zerk harcama unlar ierir A yatrm mallar iin devlet .pdf
 
Yuki is a fouryearold female growing up in a twoparent fa.pdf
Yuki is a fouryearold female growing up in a twoparent fa.pdfYuki is a fouryearold female growing up in a twoparent fa.pdf
Yuki is a fouryearold female growing up in a twoparent fa.pdf
 
Youstidy wid flewers and havn been werking on a particular a.pdf
Youstidy wid flewers and havn been werking on a particular a.pdfYoustidy wid flewers and havn been werking on a particular a.pdf
Youstidy wid flewers and havn been werking on a particular a.pdf
 
Your team has been contracted to organize and coordinate a n.pdf
Your team has been contracted to organize and coordinate a n.pdfYour team has been contracted to organize and coordinate a n.pdf
Your team has been contracted to organize and coordinate a n.pdf
 
Yzme kesesi olmayan veya yzme kesesi olan ancak hibir eki.pdf
Yzme kesesi olmayan veya yzme kesesi olan ancak hibir eki.pdfYzme kesesi olmayan veya yzme kesesi olan ancak hibir eki.pdf
Yzme kesesi olmayan veya yzme kesesi olan ancak hibir eki.pdf
 
Your group which needs a company name is currently embroil.pdf
Your group which needs a company name is currently embroil.pdfYour group which needs a company name is currently embroil.pdf
Your group which needs a company name is currently embroil.pdf
 
your in text citations c Describe your own MBTI results an.pdf
your in text citations c Describe your own MBTI results an.pdfyour in text citations c Describe your own MBTI results an.pdf
your in text citations c Describe your own MBTI results an.pdf
 
Youll need to do a review of the article given below Your .pdf
Youll need to do a review of the article given below Your .pdfYoull need to do a review of the article given below Your .pdf
Youll need to do a review of the article given below Your .pdf
 
Your analysis should comprise the following Score on each.pdf
Your analysis should comprise the following  Score on each.pdfYour analysis should comprise the following  Score on each.pdf
Your analysis should comprise the following Score on each.pdf
 
You work for portable computers which is a distributor of c.pdf
You work for portable computers which is a distributor of c.pdfYou work for portable computers which is a distributor of c.pdf
You work for portable computers which is a distributor of c.pdf
 
You only have to select one form of SPECIATION to explain an.pdf
You only have to select one form of SPECIATION to explain an.pdfYou only have to select one form of SPECIATION to explain an.pdf
You only have to select one form of SPECIATION to explain an.pdf
 
you will assume the perspective of a conflict theorist What.pdf
you will assume the perspective of a conflict theorist What.pdfyou will assume the perspective of a conflict theorist What.pdf
you will assume the perspective of a conflict theorist What.pdf
 
You have been granted an interview with Texass governor reg.pdf
You have been granted an interview with Texass governor reg.pdfYou have been granted an interview with Texass governor reg.pdf
You have been granted an interview with Texass governor reg.pdf
 

Recently uploaded

Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 

Your 1ab8 c file is doe by Friday 1159pm to be submitted.pdf

  • 1. Your 1ab8. c file is doe by Friday, 11.59pm, to be submitted on Gradescope. Overview This week, you will start with last week's program and create your own functions for some of the tasks. You'll have a printmenu () function, printarray () function and a convertcase () function. Just like you saw in class, the code from the main () function that performs each of those tasks will be moved from the the main () function and into their respective functions. More details about those functions are shown below in the Lab Assignment section. All the functions will be in one file, called lab8.c. Background Information For this lab, you will use last week's program to start with. Copy it and rename it lab8.c. Again, you will be adding more code to this program in the future, so make sure you get this one working. Functions and Reminders 1. As you saw in class, functions perform (usually) one task, or a couple of smaller tasks that combined perform a task. 2. Some functions return a value (the retum type being specified in the functon header/signature and a return statement at the bottom of the function): int printmenu() & and some functions do not return any value (the retum type then being specified as void and no return statement at the bottom of the function): void convertCase (char text [MAX_LINE] [MAX_LINE_LEN] ) i 3. When arguments are being sent to the function, the function then has "parameters" specified in the function header/signature. The parameters that are specified indicate the type and the name: void printarray (char text[MAX_LINE] [MAX_LINE_LEN], int size) { If a function is not being sent any arguments, then the parameter list will be empty (meaning nothing in the parentheses). int printMenu() f / / empty parentheses 4. When sending a 1-D array to a function, the parameter can be specified with empty square brackets: int findLowest (int theArray[], int size) f // from in-class exercise When a 2-D array is sent to a function, however, the parameter has to at least specify the number of columns. So the parameter can be specified as: void f1 (int array [][12]) If a variable is being used for the dimension(s) of the array, then the variable must appear first in the list of parameters: void 11 (int numRows, int numCols, int array 1 [numRows] [numCols]) For this lab, since the number of rows and number of columns are either idefine or constants, defined outside of the main0 function, the parameter showing the array can use those names for the dimensions without including them in the parameter list: void convertCase (char text[MAX_LINE] [MAX_LINE_LEN]) I 5. As discussed in class, to eliminate chances of confusion, you should ensure that there is no variable shadowing (the argument being sent to the function has a different name than the parameter). 6. Function prototypes should be at the top of the file, EVFN IF THE MAINO FUNCTION IS AT THE BOTTOM OF5. Function prototypes should be at the top of the file, EVEN If THE MANNO FUNCTION IS AT THE BOTTOM OF THE FILE. So the top of your file should consist of the header comment, Hinclude statements, /define statements or constant variables (if any), structure definitions (if any), prototypes - and then functions. 7. Function bodies should be preceded with a comment explaining what the function does, as well as what the inputs/outputs are: / prints a menu to the user parameters: none return: the menu choice that the user enters int printMenu() 1 /I rest of function code . Lab Assignment For this week's lab8.c program, you will start with last week's program and create your own functions for some of the tasks. You will move code from the main () function into the following functions that you will create: printmenu (), printarray (), and convertcase () functions. The prototypes and information for the three functions that you will create are shown here: int printmenu(); This function will print the menu to the user, enforcing valid input, and retum back to the main () function the user's choice.
  • 2. void printarray (char text [MAX_LINE] (MAX_LINE_LEN], int size), This function will print the contents of the array sent to it. It also has a second parameter representing the number of lines in the array. This function does not retum anything. void convertCase (char text [MAX_LINE] (MAX_LINE_LEN]); This function will convert the case of the chancters in the array sent to it. This function does not retum anvthing