SlideShare ist ein Scribd-Unternehmen logo
1 von 1
Downloaden Sie, um offline zu lesen
WRITE THE PROGRAM IN MIPS LANGUAGE ONLY THAT WORKS WITH MARS
SIMULATOR
(DONT COPY & PASTE FROM CHATGPT IT GIVES ANSWER WITH ERROR I HAVE
TRIED IT 100 TIMES BY NOW IT DOESNT SOLVE PROBLEM)
(I WROTE THAT IN BOLD BECAUSE PREVIOUS 2 EXPERT WHO ANSWERED COPIED
FROM CHATGPT)
A palindrome is a word or phrase that reads the same from left to right as right to left. A simple
palindrome is kayak, for example. Other rules are that you ignore punctuation and letter case.
For example, Madam, Im Adam is a palindrome despite commas, spaces, and upper and lower
case differences. Palindromes can also contain digits, such as 12421.
Write a program in MIPS language that works in MARS Simulator that does the following
1. Request a string from the user. If it is zero length (the first character is n) exit the program.
2. Determine if the string is a palindrome. If so, print Palindrome. If not, print Not a
palindrome.
3. Return to request another string.
Program structure:
1) You can assume no input string is longer than 200 characters.
2) 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.
3) Within this function, you must call another function that removes anything that isnt a letter
or a number.
4) Within the second function, call a third function that converts lower case to upper case so
your comparisons work properly.
5) Finally, call your recursive palindrome function.
6) 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.

Weitere ähnliche Inhalte

Ähnlich wie WRITE THE PROGRAM IN MIPS LANGUAGE ONLY THAT WORKS WITH MARS SIMULAT.pdf

Scala Language Intro - Inspired by the Love Game
Scala Language Intro - Inspired by the Love GameScala Language Intro - Inspired by the Love Game
Scala Language Intro - Inspired by the Love Game
Antony Stubbs
 
Task Perform addition subtraction division and multiplic.pdf
Task Perform addition subtraction division and multiplic.pdfTask Perform addition subtraction division and multiplic.pdf
Task Perform addition subtraction division and multiplic.pdf
acsmadurai
 
COMP 2103X1 Assignment 2Due Thursday, January 26 by 700 PM.docx
COMP 2103X1 Assignment 2Due Thursday, January 26 by 700 PM.docxCOMP 2103X1 Assignment 2Due Thursday, January 26 by 700 PM.docx
COMP 2103X1 Assignment 2Due Thursday, January 26 by 700 PM.docx
donnajames55
 
Part I (1.5 points) Write a C++ program that reads a line from the key...
Part I (1.5 points)        Write a C++ program that reads a line from the key...Part I (1.5 points)        Write a C++ program that reads a line from the key...
Part I (1.5 points) Write a C++ program that reads a line from the key...
hwbloom104
 
Questions4
Questions4Questions4
Questions4
hccit
 
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docxCMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
mary772
 

Ähnlich wie WRITE THE PROGRAM IN MIPS LANGUAGE ONLY THAT WORKS WITH MARS SIMULAT.pdf (15)

Scala Language Intro - Inspired by the Love Game
Scala Language Intro - Inspired by the Love GameScala Language Intro - Inspired by the Love Game
Scala Language Intro - Inspired by the Love Game
 
(4) cpp automatic arrays_pointers_c-strings_exercises
(4) cpp automatic arrays_pointers_c-strings_exercises(4) cpp automatic arrays_pointers_c-strings_exercises
(4) cpp automatic arrays_pointers_c-strings_exercises
 
How to make fewer errors at the stage of code writing. Part N1.
How to make fewer errors at the stage of code writing. Part N1.How to make fewer errors at the stage of code writing. Part N1.
How to make fewer errors at the stage of code writing. Part N1.
 
How to make fewer errors at the stage of code writing. Part N1
How to make fewer errors at the stage of code writing. Part N1How to make fewer errors at the stage of code writing. Part N1
How to make fewer errors at the stage of code writing. Part N1
 
Task Perform addition subtraction division and multiplic.pdf
Task Perform addition subtraction division and multiplic.pdfTask Perform addition subtraction division and multiplic.pdf
Task Perform addition subtraction division and multiplic.pdf
 
Lecture No 13.ppt
Lecture No 13.pptLecture No 13.ppt
Lecture No 13.ppt
 
What is the general format for a Try-Catch block Assume that amt l .docx
 What is the general format for a Try-Catch block  Assume that amt l .docx What is the general format for a Try-Catch block  Assume that amt l .docx
What is the general format for a Try-Catch block Assume that amt l .docx
 
C programming & data structure [character strings & string functions]
C programming & data structure   [character strings & string functions]C programming & data structure   [character strings & string functions]
C programming & data structure [character strings & string functions]
 
COMP 2103X1 Assignment 2Due Thursday, January 26 by 700 PM.docx
COMP 2103X1 Assignment 2Due Thursday, January 26 by 700 PM.docxCOMP 2103X1 Assignment 2Due Thursday, January 26 by 700 PM.docx
COMP 2103X1 Assignment 2Due Thursday, January 26 by 700 PM.docx
 
Java programlist (1)
Java programlist (1)Java programlist (1)
Java programlist (1)
 
Fortran 90 Basics
Fortran 90 BasicsFortran 90 Basics
Fortran 90 Basics
 
Part I (1.5 points) Write a C++ program that reads a line from the key...
Part I (1.5 points)        Write a C++ program that reads a line from the key...Part I (1.5 points)        Write a C++ program that reads a line from the key...
Part I (1.5 points) Write a C++ program that reads a line from the key...
 
Questions4
Questions4Questions4
Questions4
 
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docxCMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
 
Php Learning show
Php Learning showPhp Learning show
Php Learning show
 

Mehr von AMIOPTICPLUS

Yo (Rohit) me un� al proyecto CVS Caremark en TCS-Noida en noviembre.pdf
Yo (Rohit) me un� al proyecto CVS Caremark en TCS-Noida en noviembre.pdfYo (Rohit) me un� al proyecto CVS Caremark en TCS-Noida en noviembre.pdf
Yo (Rohit) me un� al proyecto CVS Caremark en TCS-Noida en noviembre.pdf
AMIOPTICPLUS
 
Yandie Izzo gestiona una estrategia de crecimiento de dividendos par.pdf
Yandie Izzo gestiona una estrategia de crecimiento de dividendos par.pdfYandie Izzo gestiona una estrategia de crecimiento de dividendos par.pdf
Yandie Izzo gestiona una estrategia de crecimiento de dividendos par.pdf
AMIOPTICPLUS
 
you are opening Tim Hortons in Nigeria.complete the sections of the .pdf
you are opening Tim Hortons in Nigeria.complete the sections of the .pdfyou are opening Tim Hortons in Nigeria.complete the sections of the .pdf
you are opening Tim Hortons in Nigeria.complete the sections of the .pdf
AMIOPTICPLUS
 

Mehr von AMIOPTICPLUS (20)

You are a doctor and come across a patient currently fighting an inf.pdf
You are a doctor and come across a patient currently fighting an inf.pdfYou are a doctor and come across a patient currently fighting an inf.pdf
You are a doctor and come across a patient currently fighting an inf.pdf
 
You are a longtime auditor of Oval Tables Inc. In the last few days .pdf
You are a longtime auditor of Oval Tables Inc. In the last few days .pdfYou are a longtime auditor of Oval Tables Inc. In the last few days .pdf
You are a longtime auditor of Oval Tables Inc. In the last few days .pdf
 
Yo (Rohit) me un� al proyecto CVS Caremark en TCS-Noida en noviembre.pdf
Yo (Rohit) me un� al proyecto CVS Caremark en TCS-Noida en noviembre.pdfYo (Rohit) me un� al proyecto CVS Caremark en TCS-Noida en noviembre.pdf
Yo (Rohit) me un� al proyecto CVS Caremark en TCS-Noida en noviembre.pdf
 
Yep Company is considering investing in Project G or Project H. Proj.pdf
Yep Company is considering investing in Project G or Project H. Proj.pdfYep Company is considering investing in Project G or Project H. Proj.pdf
Yep Company is considering investing in Project G or Project H. Proj.pdf
 
Yandie Izzo gestiona una estrategia de crecimiento de dividendos par.pdf
Yandie Izzo gestiona una estrategia de crecimiento de dividendos par.pdfYandie Izzo gestiona una estrategia de crecimiento de dividendos par.pdf
Yandie Izzo gestiona una estrategia de crecimiento de dividendos par.pdf
 
Y=(1S)(YT)+I+G+a((EP)(P))m(YT).pdf
Y=(1S)(YT)+I+G+a((EP)(P))m(YT).pdfY=(1S)(YT)+I+G+a((EP)(P))m(YT).pdf
Y=(1S)(YT)+I+G+a((EP)(P))m(YT).pdf
 
y is that corporations must create value for all of their stakeholders.pdf
y is that corporations must create value for all of their stakeholders.pdfy is that corporations must create value for all of their stakeholders.pdf
y is that corporations must create value for all of their stakeholders.pdf
 
Y=$6,000+1.pdf
Y=$6,000+1.pdfY=$6,000+1.pdf
Y=$6,000+1.pdf
 
xx warlance stacdard dewotson.pdf
xx warlance stacdard dewotson.pdfxx warlance stacdard dewotson.pdf
xx warlance stacdard dewotson.pdf
 
Xavier and Yolanda have original investments of $50,700 and $102,300.pdf
Xavier and Yolanda have original investments of $50,700 and $102,300.pdfXavier and Yolanda have original investments of $50,700 and $102,300.pdf
Xavier and Yolanda have original investments of $50,700 and $102,300.pdf
 
x is 3.pdf
x is 3.pdfx is 3.pdf
x is 3.pdf
 
X has the following probability distribution P(X) Compute the expect.pdf
X has the following probability distribution P(X)  Compute the expect.pdfX has the following probability distribution P(X)  Compute the expect.pdf
X has the following probability distribution P(X) Compute the expect.pdf
 
Written descriptions of how to input data and how to invoke the func.pdf
Written descriptions of how to input data and how to invoke the func.pdfWritten descriptions of how to input data and how to invoke the func.pdf
Written descriptions of how to input data and how to invoke the func.pdf
 
You get a bunch of photos with certain information about them. With .pdf
You get a bunch of photos with certain information about them. With .pdfYou get a bunch of photos with certain information about them. With .pdf
You get a bunch of photos with certain information about them. With .pdf
 
writing a paper about Migraine using these 3 articles Migraine A Hi.pdf
writing a paper about Migraine using these 3 articles Migraine A Hi.pdfwriting a paper about Migraine using these 3 articles Migraine A Hi.pdf
writing a paper about Migraine using these 3 articles Migraine A Hi.pdf
 
You are working as a network engineer for an IT company called YorkI.pdf
You are working as a network engineer for an IT company called YorkI.pdfYou are working as a network engineer for an IT company called YorkI.pdf
You are working as a network engineer for an IT company called YorkI.pdf
 
You are the PM on a software upgrade project. You find out from a se.pdf
You are the PM on a software upgrade project. You find out from a se.pdfYou are the PM on a software upgrade project. You find out from a se.pdf
You are the PM on a software upgrade project. You find out from a se.pdf
 
you are opening Tim Hortons in Nigeria.complete the sections of the .pdf
you are opening Tim Hortons in Nigeria.complete the sections of the .pdfyou are opening Tim Hortons in Nigeria.complete the sections of the .pdf
you are opening Tim Hortons in Nigeria.complete the sections of the .pdf
 
You are meeting your client, Henry, who is 70 years old. Henry took .pdf
You are meeting your client, Henry, who is 70 years old. Henry took .pdfYou are meeting your client, Henry, who is 70 years old. Henry took .pdf
You are meeting your client, Henry, who is 70 years old. Henry took .pdf
 
You are Maria Herrera and have been recently promoted to the positio.pdf
You are Maria Herrera and have been recently promoted to the positio.pdfYou are Maria Herrera and have been recently promoted to the positio.pdf
You are Maria Herrera and have been recently promoted to the positio.pdf
 

Kürzlich hochgeladen

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Kürzlich hochgeladen (20)

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

WRITE THE PROGRAM IN MIPS LANGUAGE ONLY THAT WORKS WITH MARS SIMULAT.pdf

  • 1. WRITE THE PROGRAM IN MIPS LANGUAGE ONLY THAT WORKS WITH MARS SIMULATOR (DONT COPY & PASTE FROM CHATGPT IT GIVES ANSWER WITH ERROR I HAVE TRIED IT 100 TIMES BY NOW IT DOESNT SOLVE PROBLEM) (I WROTE THAT IN BOLD BECAUSE PREVIOUS 2 EXPERT WHO ANSWERED COPIED FROM CHATGPT) A palindrome is a word or phrase that reads the same from left to right as right to left. A simple palindrome is kayak, for example. Other rules are that you ignore punctuation and letter case. For example, Madam, Im Adam is a palindrome despite commas, spaces, and upper and lower case differences. Palindromes can also contain digits, such as 12421. Write a program in MIPS language that works in MARS Simulator that does the following 1. Request a string from the user. If it is zero length (the first character is n) exit the program. 2. Determine if the string is a palindrome. If so, print Palindrome. If not, print Not a palindrome. 3. Return to request another string. Program structure: 1) You can assume no input string is longer than 200 characters. 2) 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. 3) Within this function, you must call another function that removes anything that isnt a letter or a number. 4) Within the second function, call a third function that converts lower case to upper case so your comparisons work properly. 5) Finally, call your recursive palindrome function. 6) 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.