SlideShare uma empresa Scribd logo
1 de 1
Baixar para ler offline
SHOULD BE WRITTEN IN MIPS LANGUAGE ONLY THAT WORKS WITH MARS
SIMULATOR
( PLEASE DON'T COPY PASTE FROM CHATGPT AS SOMEONE DID THE SAME WITH
PREVIOUS QUESTION, CHATGPT WILL GIVE WRONG ANSWER!!!)
Write a program that does the following:
Request a string from the user. If it is zero length (the first character is n) exit the program.
Determine if the string is a palindrome. If so, print Palindrome. If not, print Not a palindrome.
Return to request another string.
Program structure:
You can assume no input string is longer than 200 characters. You must write a function that
determines whether the string is a palindrome. Call this with the address of the string in $a0. This
function must be recursive. That is, it must test whether the initial string might be a palindrome
and return true if it the outer two characters match and false if they dont, meaning if you return
false at any level, stop the recursive calls and return false. Within this function, you must call
another function that removes anything that isnt a letter or a number. Within the second function,
call a third function that converts lower case to upper case so your comparisons work properly.
Finally, call your recursive palindrome function. You should have two files. The first has the
main body of your code that requests a string, calls a function that checks a palindrome, which is
item 2, above plus initialization code. The second file has any subroutines you may need, such as
removing punctuation and converting case.

Mais conteúdo relacionado

Mais de leolight2

Show the Relational Algebra formula for each. This one may be a phot.pdf
Show the Relational Algebra formula for each. This one may be a phot.pdfShow the Relational Algebra formula for each. This one may be a phot.pdf
Show the Relational Algebra formula for each. This one may be a phot.pdfleolight2
 
should be at least two paragraphs long, or more, depending upon the .pdf
should be at least two paragraphs long, or more, depending upon the .pdfshould be at least two paragraphs long, or more, depending upon the .pdf
should be at least two paragraphs long, or more, depending upon the .pdfleolight2
 
Should Governments Report Like BusinessesHistorically, states a.pdf
Should Governments Report Like BusinessesHistorically, states a.pdfShould Governments Report Like BusinessesHistorically, states a.pdf
Should Governments Report Like BusinessesHistorically, states a.pdfleolight2
 
Seventy-three percent of adults in a certain country believe that li.pdf
Seventy-three percent of adults in a certain country believe that li.pdfSeventy-three percent of adults in a certain country believe that li.pdf
Seventy-three percent of adults in a certain country believe that li.pdfleolight2
 
Sheffield Corporation, a private corporation, was organized on Febru.pdf
Sheffield Corporation, a private corporation, was organized on Febru.pdfSheffield Corporation, a private corporation, was organized on Febru.pdf
Sheffield Corporation, a private corporation, was organized on Febru.pdfleolight2
 
SHOW ANSWER ON GRAPH Many demographers predict that the United State.pdf
SHOW ANSWER ON GRAPH Many demographers predict that the United State.pdfSHOW ANSWER ON GRAPH Many demographers predict that the United State.pdf
SHOW ANSWER ON GRAPH Many demographers predict that the United State.pdfleolight2
 
Ser capaz de amplificar fragmentos de ADN espec�ficos es fundamental.pdf
Ser capaz de amplificar fragmentos de ADN espec�ficos es fundamental.pdfSer capaz de amplificar fragmentos de ADN espec�ficos es fundamental.pdf
Ser capaz de amplificar fragmentos de ADN espec�ficos es fundamental.pdfleolight2
 
Solve all of them If the marginal propensity to save is 0.25 , then.pdf
Solve all of them  If the marginal propensity to save is 0.25 , then.pdfSolve all of them  If the marginal propensity to save is 0.25 , then.pdf
Solve all of them If the marginal propensity to save is 0.25 , then.pdfleolight2
 
Solution Register a service endpoint in the Dataverse instance that.pdf
Solution Register a service endpoint in the Dataverse instance that.pdfSolution Register a service endpoint in the Dataverse instance that.pdf
Solution Register a service endpoint in the Dataverse instance that.pdfleolight2
 
Solutions for The Toliza Museum of Art, did not cover all the answer.pdf
Solutions for The Toliza Museum of Art, did not cover all the answer.pdfSolutions for The Toliza Museum of Art, did not cover all the answer.pdf
Solutions for The Toliza Museum of Art, did not cover all the answer.pdfleolight2
 
Soles es una empresa de calzado que ha abierto recientemente su tien.pdf
Soles es una empresa de calzado que ha abierto recientemente su tien.pdfSoles es una empresa de calzado que ha abierto recientemente su tien.pdf
Soles es una empresa de calzado que ha abierto recientemente su tien.pdfleolight2
 
So I have 3 enums named land_type, entity, tile as shown enum lan.pdf
So I have 3 enums named land_type, entity, tile as shown enum lan.pdfSo I have 3 enums named land_type, entity, tile as shown enum lan.pdf
So I have 3 enums named land_type, entity, tile as shown enum lan.pdfleolight2
 
So for C-ferns the CP is the commonwild type (green) and the cp is .pdf
So for C-ferns the CP is the commonwild type (green) and the cp is .pdfSo for C-ferns the CP is the commonwild type (green) and the cp is .pdf
So for C-ferns the CP is the commonwild type (green) and the cp is .pdfleolight2
 
So I need to create a compound word game, and I dont quite understa.pdf
So I need to create a compound word game, and I dont quite understa.pdfSo I need to create a compound word game, and I dont quite understa.pdf
So I need to create a compound word game, and I dont quite understa.pdfleolight2
 
SLL Corporation�s balance sheet is shown below. The current rate on .pdf
SLL Corporation�s balance sheet is shown below. The current rate on .pdfSLL Corporation�s balance sheet is shown below. The current rate on .pdf
SLL Corporation�s balance sheet is shown below. The current rate on .pdfleolight2
 
So here is the code from the previous assignment that we need to ext.pdf
So here is the code from the previous assignment that we need to ext.pdfSo here is the code from the previous assignment that we need to ext.pdf
So here is the code from the previous assignment that we need to ext.pdfleolight2
 
Solaris, Inc. tiene 2000 acciones del 5 , valor nominal de $10, acc.pdf
Solaris, Inc. tiene 2000 acciones del 5 , valor nominal de $10, acc.pdfSolaris, Inc. tiene 2000 acciones del 5 , valor nominal de $10, acc.pdf
Solaris, Inc. tiene 2000 acciones del 5 , valor nominal de $10, acc.pdfleolight2
 
Slapshot Company makes ice hockey sticks. During the month of June, .pdf
Slapshot Company makes ice hockey sticks. During the month of June, .pdfSlapshot Company makes ice hockey sticks. During the month of June, .pdf
Slapshot Company makes ice hockey sticks. During the month of June, .pdfleolight2
 
SGI versus Dell competencia en servidores y computaci�n en la nube.pdf
SGI versus Dell competencia en servidores y computaci�n en la nube.pdfSGI versus Dell competencia en servidores y computaci�n en la nube.pdf
SGI versus Dell competencia en servidores y computaci�n en la nube.pdfleolight2
 
Si escuchara que la diversidad cultural est� desapareciendo en una d.pdf
Si escuchara que la diversidad cultural est� desapareciendo en una d.pdfSi escuchara que la diversidad cultural est� desapareciendo en una d.pdf
Si escuchara que la diversidad cultural est� desapareciendo en una d.pdfleolight2
 

Mais de leolight2 (20)

Show the Relational Algebra formula for each. This one may be a phot.pdf
Show the Relational Algebra formula for each. This one may be a phot.pdfShow the Relational Algebra formula for each. This one may be a phot.pdf
Show the Relational Algebra formula for each. This one may be a phot.pdf
 
should be at least two paragraphs long, or more, depending upon the .pdf
should be at least two paragraphs long, or more, depending upon the .pdfshould be at least two paragraphs long, or more, depending upon the .pdf
should be at least two paragraphs long, or more, depending upon the .pdf
 
Should Governments Report Like BusinessesHistorically, states a.pdf
Should Governments Report Like BusinessesHistorically, states a.pdfShould Governments Report Like BusinessesHistorically, states a.pdf
Should Governments Report Like BusinessesHistorically, states a.pdf
 
Seventy-three percent of adults in a certain country believe that li.pdf
Seventy-three percent of adults in a certain country believe that li.pdfSeventy-three percent of adults in a certain country believe that li.pdf
Seventy-three percent of adults in a certain country believe that li.pdf
 
Sheffield Corporation, a private corporation, was organized on Febru.pdf
Sheffield Corporation, a private corporation, was organized on Febru.pdfSheffield Corporation, a private corporation, was organized on Febru.pdf
Sheffield Corporation, a private corporation, was organized on Febru.pdf
 
SHOW ANSWER ON GRAPH Many demographers predict that the United State.pdf
SHOW ANSWER ON GRAPH Many demographers predict that the United State.pdfSHOW ANSWER ON GRAPH Many demographers predict that the United State.pdf
SHOW ANSWER ON GRAPH Many demographers predict that the United State.pdf
 
Ser capaz de amplificar fragmentos de ADN espec�ficos es fundamental.pdf
Ser capaz de amplificar fragmentos de ADN espec�ficos es fundamental.pdfSer capaz de amplificar fragmentos de ADN espec�ficos es fundamental.pdf
Ser capaz de amplificar fragmentos de ADN espec�ficos es fundamental.pdf
 
Solve all of them If the marginal propensity to save is 0.25 , then.pdf
Solve all of them  If the marginal propensity to save is 0.25 , then.pdfSolve all of them  If the marginal propensity to save is 0.25 , then.pdf
Solve all of them If the marginal propensity to save is 0.25 , then.pdf
 
Solution Register a service endpoint in the Dataverse instance that.pdf
Solution Register a service endpoint in the Dataverse instance that.pdfSolution Register a service endpoint in the Dataverse instance that.pdf
Solution Register a service endpoint in the Dataverse instance that.pdf
 
Solutions for The Toliza Museum of Art, did not cover all the answer.pdf
Solutions for The Toliza Museum of Art, did not cover all the answer.pdfSolutions for The Toliza Museum of Art, did not cover all the answer.pdf
Solutions for The Toliza Museum of Art, did not cover all the answer.pdf
 
Soles es una empresa de calzado que ha abierto recientemente su tien.pdf
Soles es una empresa de calzado que ha abierto recientemente su tien.pdfSoles es una empresa de calzado que ha abierto recientemente su tien.pdf
Soles es una empresa de calzado que ha abierto recientemente su tien.pdf
 
So I have 3 enums named land_type, entity, tile as shown enum lan.pdf
So I have 3 enums named land_type, entity, tile as shown enum lan.pdfSo I have 3 enums named land_type, entity, tile as shown enum lan.pdf
So I have 3 enums named land_type, entity, tile as shown enum lan.pdf
 
So for C-ferns the CP is the commonwild type (green) and the cp is .pdf
So for C-ferns the CP is the commonwild type (green) and the cp is .pdfSo for C-ferns the CP is the commonwild type (green) and the cp is .pdf
So for C-ferns the CP is the commonwild type (green) and the cp is .pdf
 
So I need to create a compound word game, and I dont quite understa.pdf
So I need to create a compound word game, and I dont quite understa.pdfSo I need to create a compound word game, and I dont quite understa.pdf
So I need to create a compound word game, and I dont quite understa.pdf
 
SLL Corporation�s balance sheet is shown below. The current rate on .pdf
SLL Corporation�s balance sheet is shown below. The current rate on .pdfSLL Corporation�s balance sheet is shown below. The current rate on .pdf
SLL Corporation�s balance sheet is shown below. The current rate on .pdf
 
So here is the code from the previous assignment that we need to ext.pdf
So here is the code from the previous assignment that we need to ext.pdfSo here is the code from the previous assignment that we need to ext.pdf
So here is the code from the previous assignment that we need to ext.pdf
 
Solaris, Inc. tiene 2000 acciones del 5 , valor nominal de $10, acc.pdf
Solaris, Inc. tiene 2000 acciones del 5 , valor nominal de $10, acc.pdfSolaris, Inc. tiene 2000 acciones del 5 , valor nominal de $10, acc.pdf
Solaris, Inc. tiene 2000 acciones del 5 , valor nominal de $10, acc.pdf
 
Slapshot Company makes ice hockey sticks. During the month of June, .pdf
Slapshot Company makes ice hockey sticks. During the month of June, .pdfSlapshot Company makes ice hockey sticks. During the month of June, .pdf
Slapshot Company makes ice hockey sticks. During the month of June, .pdf
 
SGI versus Dell competencia en servidores y computaci�n en la nube.pdf
SGI versus Dell competencia en servidores y computaci�n en la nube.pdfSGI versus Dell competencia en servidores y computaci�n en la nube.pdf
SGI versus Dell competencia en servidores y computaci�n en la nube.pdf
 
Si escuchara que la diversidad cultural est� desapareciendo en una d.pdf
Si escuchara que la diversidad cultural est� desapareciendo en una d.pdfSi escuchara que la diversidad cultural est� desapareciendo en una d.pdf
Si escuchara que la diversidad cultural est� desapareciendo en una d.pdf
 

Último

Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 

Último (20)

Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 

SHOULD BE WRITTEN IN MIPS LANGUAGE ONLY THAT WORKS WITH MARS SIMULAT.pdf

  • 1. SHOULD BE WRITTEN IN MIPS LANGUAGE ONLY THAT WORKS WITH MARS SIMULATOR ( PLEASE DON'T COPY PASTE FROM CHATGPT AS SOMEONE DID THE SAME WITH PREVIOUS QUESTION, CHATGPT WILL GIVE WRONG ANSWER!!!) Write a program that does the following: Request a string from the user. If it is zero length (the first character is n) exit the program. Determine if the string is a palindrome. If so, print Palindrome. If not, print Not a palindrome. Return to request another string. Program structure: You can assume no input string is longer than 200 characters. You must write a function that determines whether the string is a palindrome. Call this with the address of the string in $a0. This function must be recursive. That is, it must test whether the initial string might be a palindrome and return true if it the outer two characters match and false if they dont, meaning if you return false at any level, stop the recursive calls and return false. Within this function, you must call another function that removes anything that isnt a letter or a number. Within the second function, call a third function that converts lower case to upper case so your comparisons work properly. Finally, call your recursive palindrome function. You should have two files. The first has the main body of your code that requests a string, calls a function that checks a palindrome, which is item 2, above plus initialization code. The second file has any subroutines you may need, such as removing punctuation and converting case.