SlideShare a Scribd company logo
1 of 7
Download to read offline
Write the program in MIPS that declares an array of positive integers. The size of the array is not
fixed. The final element of the array should have the value of 0xF, which is not used in
calculations, and should be used to calculate the size of the array. The program can prompt the
user for an integer input. Compare the input with the array. Display the index of the input in the
array if found. If the number does not match any element in the array, insert the number in the
array in sorted order. The program is terminated when input a negative integer. Print the new
array with appropriate message on the screen. For example assume an array as follows:
(array: .word 4, 5, 23, 5, 8, 3, 15, 67, 8, 9, 0xF)
Sorted array: 3, 4, 5, 5, 8, 8, 9, 15, 23, 67
Enter a number to search: 20
Number not found. Added to array.
Sorted array: 3, 4, 5, 5, 8, 8, 9, 15, 20, 23, 67
Enter a number to search: 5
Number at index 2
Solution
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)
import java.util.Scanner;
public category Ascending _Order
for (int i = 0; i < n; i++)
temporary worker = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
System.out.print("Ascending Order:");
for (int i = 0; i < n - 1; i++)

More Related Content

Similar to Write the program in MIPS that declares an array of positive integer.pdf

Demonstrating bully algorithm in java
Demonstrating bully algorithm in javaDemonstrating bully algorithm in java
Demonstrating bully algorithm in javaNagireddy Dwarampudi
 
Lab01.pptx
Lab01.pptxLab01.pptx
Lab01.pptxKimVeeL
 
Create a menu-driven program that will accept a collection of non-ne.pdf
Create a menu-driven program that will accept a collection of non-ne.pdfCreate a menu-driven program that will accept a collection of non-ne.pdf
Create a menu-driven program that will accept a collection of non-ne.pdfrajeshjangid1865
 
Please help with this JAVA Assignment and show output if you can ple.pdf
Please help with this JAVA Assignment and show output if you can ple.pdfPlease help with this JAVA Assignment and show output if you can ple.pdf
Please help with this JAVA Assignment and show output if you can ple.pdfaroramobiles1
 
Lab101.pptx
Lab101.pptxLab101.pptx
Lab101.pptxKimVeeL
 
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...MaruMengesha
 
Write a Java application that asks for an integer and returns its fac.pdf
Write a Java application that asks for an integer and returns its fac.pdfWrite a Java application that asks for an integer and returns its fac.pdf
Write a Java application that asks for an integer and returns its fac.pdfhadpadrrajeshh
 
DS LAB RECORD.docx
DS LAB RECORD.docxDS LAB RECORD.docx
DS LAB RECORD.docxdavinci54
 
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdfSumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdfankkitextailes
 
Java Simple Programs
Java Simple ProgramsJava Simple Programs
Java Simple ProgramsUpender Upr
 
An input file A1-txt is given which contains a list of integer values-.docx
An input file A1-txt is given which contains a list of integer values-.docxAn input file A1-txt is given which contains a list of integer values-.docx
An input file A1-txt is given which contains a list of integer values-.docxlauracallander
 
1. import java.util.Scanner; public class Alphabetical_Order {.pdf
1. import java.util.Scanner; public class Alphabetical_Order {.pdf1. import java.util.Scanner; public class Alphabetical_Order {.pdf
1. import java.util.Scanner; public class Alphabetical_Order {.pdfAnkitchhabra28
 

Similar to Write the program in MIPS that declares an array of positive integer.pdf (17)

Demonstrating bully algorithm in java
Demonstrating bully algorithm in javaDemonstrating bully algorithm in java
Demonstrating bully algorithm in java
 
Lab01.pptx
Lab01.pptxLab01.pptx
Lab01.pptx
 
Pnno
PnnoPnno
Pnno
 
Create a menu-driven program that will accept a collection of non-ne.pdf
Create a menu-driven program that will accept a collection of non-ne.pdfCreate a menu-driven program that will accept a collection of non-ne.pdf
Create a menu-driven program that will accept a collection of non-ne.pdf
 
Please help with this JAVA Assignment and show output if you can ple.pdf
Please help with this JAVA Assignment and show output if you can ple.pdfPlease help with this JAVA Assignment and show output if you can ple.pdf
Please help with this JAVA Assignment and show output if you can ple.pdf
 
Programs of java
Programs of javaPrograms of java
Programs of java
 
Lab101.pptx
Lab101.pptxLab101.pptx
Lab101.pptx
 
LAB1.docx
LAB1.docxLAB1.docx
LAB1.docx
 
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
 
Write a Java application that asks for an integer and returns its fac.pdf
Write a Java application that asks for an integer and returns its fac.pdfWrite a Java application that asks for an integer and returns its fac.pdf
Write a Java application that asks for an integer and returns its fac.pdf
 
DS LAB RECORD.docx
DS LAB RECORD.docxDS LAB RECORD.docx
DS LAB RECORD.docx
 
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdfSumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdf
 
Java file
Java fileJava file
Java file
 
Java file
Java fileJava file
Java file
 
Java Simple Programs
Java Simple ProgramsJava Simple Programs
Java Simple Programs
 
An input file A1-txt is given which contains a list of integer values-.docx
An input file A1-txt is given which contains a list of integer values-.docxAn input file A1-txt is given which contains a list of integer values-.docx
An input file A1-txt is given which contains a list of integer values-.docx
 
1. import java.util.Scanner; public class Alphabetical_Order {.pdf
1. import java.util.Scanner; public class Alphabetical_Order {.pdf1. import java.util.Scanner; public class Alphabetical_Order {.pdf
1. import java.util.Scanner; public class Alphabetical_Order {.pdf
 

More from arihanthtoysandgifts

Need help finding the error in my code. Wherever theres a player.pdf
Need help finding the error in my code. Wherever theres a player.pdfNeed help finding the error in my code. Wherever theres a player.pdf
Need help finding the error in my code. Wherever theres a player.pdfarihanthtoysandgifts
 
Match the following cell structures in the Amoeba to their definition.pdf
Match the following cell structures in the Amoeba to their definition.pdfMatch the following cell structures in the Amoeba to their definition.pdf
Match the following cell structures in the Amoeba to their definition.pdfarihanthtoysandgifts
 
Let D P2(R) P1(R) defined by D(p) = p . Where p is the deriva.pdf
Let D  P2(R)  P1(R) defined by D(p) = p . Where p is the deriva.pdfLet D  P2(R)  P1(R) defined by D(p) = p . Where p is the deriva.pdf
Let D P2(R) P1(R) defined by D(p) = p . Where p is the deriva.pdfarihanthtoysandgifts
 
Islam and Supply-Side EconomicsSupply-side economics has a long hi.pdf
Islam and Supply-Side EconomicsSupply-side economics has a long hi.pdfIslam and Supply-Side EconomicsSupply-side economics has a long hi.pdf
Islam and Supply-Side EconomicsSupply-side economics has a long hi.pdfarihanthtoysandgifts
 
Is there a vertex common to every longest path in the following graph.pdf
Is there a vertex common to every longest path in the following graph.pdfIs there a vertex common to every longest path in the following graph.pdf
Is there a vertex common to every longest path in the following graph.pdfarihanthtoysandgifts
 
Increasingly there is political discussion in carbon dioxide as well.pdf
Increasingly there is political discussion in carbon dioxide as well.pdfIncreasingly there is political discussion in carbon dioxide as well.pdf
Increasingly there is political discussion in carbon dioxide as well.pdfarihanthtoysandgifts
 
In the following diagram, identify the labeled bony landmarks and ope.pdf
In the following diagram, identify the labeled bony landmarks and ope.pdfIn the following diagram, identify the labeled bony landmarks and ope.pdf
In the following diagram, identify the labeled bony landmarks and ope.pdfarihanthtoysandgifts
 
In January 2017, Bramble Corp., a newly formed company, issued 10400.pdf
In January 2017, Bramble Corp., a newly formed company, issued 10400.pdfIn January 2017, Bramble Corp., a newly formed company, issued 10400.pdf
In January 2017, Bramble Corp., a newly formed company, issued 10400.pdfarihanthtoysandgifts
 
How do humans detect color Considering your answer to this question.pdf
How do humans detect color Considering your answer to this question.pdfHow do humans detect color Considering your answer to this question.pdf
How do humans detect color Considering your answer to this question.pdfarihanthtoysandgifts
 
Identify the unique characteristics of auditing professionSoluti.pdf
Identify the unique characteristics of auditing professionSoluti.pdfIdentify the unique characteristics of auditing professionSoluti.pdf
Identify the unique characteristics of auditing professionSoluti.pdfarihanthtoysandgifts
 
Hemophilia is a recessive trait. The dominant trait is normal blood d.pdf
Hemophilia is a recessive trait. The dominant trait is normal blood d.pdfHemophilia is a recessive trait. The dominant trait is normal blood d.pdf
Hemophilia is a recessive trait. The dominant trait is normal blood d.pdfarihanthtoysandgifts
 
Explain the purpose of the Medium Access Control (MAC) timing paramet.pdf
Explain the purpose of the Medium Access Control (MAC) timing paramet.pdfExplain the purpose of the Medium Access Control (MAC) timing paramet.pdf
Explain the purpose of the Medium Access Control (MAC) timing paramet.pdfarihanthtoysandgifts
 
find the payment necessary to amortize 8 loan of $1500 for 19 compo.pdf
find the payment necessary to amortize 8 loan of $1500 for 19 compo.pdffind the payment necessary to amortize 8 loan of $1500 for 19 compo.pdf
find the payment necessary to amortize 8 loan of $1500 for 19 compo.pdfarihanthtoysandgifts
 
explain why HCO3- levels can be calculated from pH and pCO2 levels.pdf
explain why HCO3- levels can be calculated from pH and pCO2 levels.pdfexplain why HCO3- levels can be calculated from pH and pCO2 levels.pdf
explain why HCO3- levels can be calculated from pH and pCO2 levels.pdfarihanthtoysandgifts
 
Describe the arrangement of neurons in the primary motor cortexS.pdf
Describe the arrangement of neurons in the primary motor cortexS.pdfDescribe the arrangement of neurons in the primary motor cortexS.pdf
Describe the arrangement of neurons in the primary motor cortexS.pdfarihanthtoysandgifts
 
Cell Image Cell type eukaryotic cell t prokaryotic cell Solution.pdf
Cell Image Cell type eukaryotic cell t prokaryotic cell Solution.pdfCell Image Cell type eukaryotic cell t prokaryotic cell Solution.pdf
Cell Image Cell type eukaryotic cell t prokaryotic cell Solution.pdfarihanthtoysandgifts
 
An inbred line of Drosophila will drink sugar water to which small am.pdf
An inbred line of Drosophila will drink sugar water to which small am.pdfAn inbred line of Drosophila will drink sugar water to which small am.pdf
An inbred line of Drosophila will drink sugar water to which small am.pdfarihanthtoysandgifts
 
ACC312 Federal TaxationTax avoidanceTax evasion questions1. The.pdf
ACC312 Federal TaxationTax avoidanceTax evasion questions1. The.pdfACC312 Federal TaxationTax avoidanceTax evasion questions1. The.pdf
ACC312 Federal TaxationTax avoidanceTax evasion questions1. The.pdfarihanthtoysandgifts
 
a total of 100 students are taking a history exam. each student is r.pdf
a total of 100 students are taking a history exam. each student is r.pdfa total of 100 students are taking a history exam. each student is r.pdf
a total of 100 students are taking a history exam. each student is r.pdfarihanthtoysandgifts
 
A case study of a young man with a viral infection In the late winte.pdf
A case study of a young man with a viral infection  In the late winte.pdfA case study of a young man with a viral infection  In the late winte.pdf
A case study of a young man with a viral infection In the late winte.pdfarihanthtoysandgifts
 

More from arihanthtoysandgifts (20)

Need help finding the error in my code. Wherever theres a player.pdf
Need help finding the error in my code. Wherever theres a player.pdfNeed help finding the error in my code. Wherever theres a player.pdf
Need help finding the error in my code. Wherever theres a player.pdf
 
Match the following cell structures in the Amoeba to their definition.pdf
Match the following cell structures in the Amoeba to their definition.pdfMatch the following cell structures in the Amoeba to their definition.pdf
Match the following cell structures in the Amoeba to their definition.pdf
 
Let D P2(R) P1(R) defined by D(p) = p . Where p is the deriva.pdf
Let D  P2(R)  P1(R) defined by D(p) = p . Where p is the deriva.pdfLet D  P2(R)  P1(R) defined by D(p) = p . Where p is the deriva.pdf
Let D P2(R) P1(R) defined by D(p) = p . Where p is the deriva.pdf
 
Islam and Supply-Side EconomicsSupply-side economics has a long hi.pdf
Islam and Supply-Side EconomicsSupply-side economics has a long hi.pdfIslam and Supply-Side EconomicsSupply-side economics has a long hi.pdf
Islam and Supply-Side EconomicsSupply-side economics has a long hi.pdf
 
Is there a vertex common to every longest path in the following graph.pdf
Is there a vertex common to every longest path in the following graph.pdfIs there a vertex common to every longest path in the following graph.pdf
Is there a vertex common to every longest path in the following graph.pdf
 
Increasingly there is political discussion in carbon dioxide as well.pdf
Increasingly there is political discussion in carbon dioxide as well.pdfIncreasingly there is political discussion in carbon dioxide as well.pdf
Increasingly there is political discussion in carbon dioxide as well.pdf
 
In the following diagram, identify the labeled bony landmarks and ope.pdf
In the following diagram, identify the labeled bony landmarks and ope.pdfIn the following diagram, identify the labeled bony landmarks and ope.pdf
In the following diagram, identify the labeled bony landmarks and ope.pdf
 
In January 2017, Bramble Corp., a newly formed company, issued 10400.pdf
In January 2017, Bramble Corp., a newly formed company, issued 10400.pdfIn January 2017, Bramble Corp., a newly formed company, issued 10400.pdf
In January 2017, Bramble Corp., a newly formed company, issued 10400.pdf
 
How do humans detect color Considering your answer to this question.pdf
How do humans detect color Considering your answer to this question.pdfHow do humans detect color Considering your answer to this question.pdf
How do humans detect color Considering your answer to this question.pdf
 
Identify the unique characteristics of auditing professionSoluti.pdf
Identify the unique characteristics of auditing professionSoluti.pdfIdentify the unique characteristics of auditing professionSoluti.pdf
Identify the unique characteristics of auditing professionSoluti.pdf
 
Hemophilia is a recessive trait. The dominant trait is normal blood d.pdf
Hemophilia is a recessive trait. The dominant trait is normal blood d.pdfHemophilia is a recessive trait. The dominant trait is normal blood d.pdf
Hemophilia is a recessive trait. The dominant trait is normal blood d.pdf
 
Explain the purpose of the Medium Access Control (MAC) timing paramet.pdf
Explain the purpose of the Medium Access Control (MAC) timing paramet.pdfExplain the purpose of the Medium Access Control (MAC) timing paramet.pdf
Explain the purpose of the Medium Access Control (MAC) timing paramet.pdf
 
find the payment necessary to amortize 8 loan of $1500 for 19 compo.pdf
find the payment necessary to amortize 8 loan of $1500 for 19 compo.pdffind the payment necessary to amortize 8 loan of $1500 for 19 compo.pdf
find the payment necessary to amortize 8 loan of $1500 for 19 compo.pdf
 
explain why HCO3- levels can be calculated from pH and pCO2 levels.pdf
explain why HCO3- levels can be calculated from pH and pCO2 levels.pdfexplain why HCO3- levels can be calculated from pH and pCO2 levels.pdf
explain why HCO3- levels can be calculated from pH and pCO2 levels.pdf
 
Describe the arrangement of neurons in the primary motor cortexS.pdf
Describe the arrangement of neurons in the primary motor cortexS.pdfDescribe the arrangement of neurons in the primary motor cortexS.pdf
Describe the arrangement of neurons in the primary motor cortexS.pdf
 
Cell Image Cell type eukaryotic cell t prokaryotic cell Solution.pdf
Cell Image Cell type eukaryotic cell t prokaryotic cell Solution.pdfCell Image Cell type eukaryotic cell t prokaryotic cell Solution.pdf
Cell Image Cell type eukaryotic cell t prokaryotic cell Solution.pdf
 
An inbred line of Drosophila will drink sugar water to which small am.pdf
An inbred line of Drosophila will drink sugar water to which small am.pdfAn inbred line of Drosophila will drink sugar water to which small am.pdf
An inbred line of Drosophila will drink sugar water to which small am.pdf
 
ACC312 Federal TaxationTax avoidanceTax evasion questions1. The.pdf
ACC312 Federal TaxationTax avoidanceTax evasion questions1. The.pdfACC312 Federal TaxationTax avoidanceTax evasion questions1. The.pdf
ACC312 Federal TaxationTax avoidanceTax evasion questions1. The.pdf
 
a total of 100 students are taking a history exam. each student is r.pdf
a total of 100 students are taking a history exam. each student is r.pdfa total of 100 students are taking a history exam. each student is r.pdf
a total of 100 students are taking a history exam. each student is r.pdf
 
A case study of a young man with a viral infection In the late winte.pdf
A case study of a young man with a viral infection  In the late winte.pdfA case study of a young man with a viral infection  In the late winte.pdf
A case study of a young man with a viral infection In the late winte.pdf
 

Recently uploaded

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
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
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 ConsultingTechSoup
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
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
 
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
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
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
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 

Recently uploaded (20)

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.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
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
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
 
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
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
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
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 

Write the program in MIPS that declares an array of positive integer.pdf

  • 1. Write the program in MIPS that declares an array of positive integers. The size of the array is not fixed. The final element of the array should have the value of 0xF, which is not used in calculations, and should be used to calculate the size of the array. The program can prompt the user for an integer input. Compare the input with the array. Display the index of the input in the array if found. If the number does not match any element in the array, insert the number in the array in sorted order. The program is terminated when input a negative integer. Print the new array with appropriate message on the screen. For example assume an array as follows: (array: .word 4, 5, 23, 5, 8, 3, 15, 67, 8, 9, 0xF) Sorted array: 3, 4, 5, 5, 8, 8, 9, 15, 23, 67 Enter a number to search: 20 Number not found. Added to array. Sorted array: 3, 4, 5, 5, 8, 8, 9, 15, 20, 23, 67 Enter a number to search: 5 Number at index 2 Solution import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++) temporary worker = a[i]; a[i] = a[j]; a[j] = temp; } } } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++) import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++) temporary worker = a[i]; a[i] = a[j]; a[j] = temp;
  • 2. } } } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++) import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++) temporary worker = a[i]; a[i] = a[j]; a[j] = temp; } } } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++) import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++) temporary worker = a[i]; a[i] = a[j]; a[j] = temp; } } } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++) import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++) temporary worker = a[i]; a[i] = a[j]; a[j] = temp; } }
  • 3. } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++) import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++) temporary worker = a[i]; a[i] = a[j]; a[j] = temp; } } } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++) import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++) temporary worker = a[i]; a[i] = a[j]; a[j] = temp; } } } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++) import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++) temporary worker = a[i]; a[i] = a[j]; a[j] = temp; } } } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++)
  • 4. import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++) temporary worker = a[i]; a[i] = a[j]; a[j] = temp; } } } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++) import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++) temporary worker = a[i]; a[i] = a[j]; a[j] = temp; } } } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++) import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++) temporary worker = a[i]; a[i] = a[j]; a[j] = temp; } } } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++) import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++)
  • 5. temporary worker = a[i]; a[i] = a[j]; a[j] = temp; } } } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++) import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++) temporary worker = a[i]; a[i] = a[j]; a[j] = temp; } } } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++) import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++) temporary worker = a[i]; a[i] = a[j]; a[j] = temp; } } } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++) import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++) temporary worker = a[i]; a[i] = a[j];
  • 6. a[j] = temp; } } } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++) import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++) temporary worker = a[i]; a[i] = a[j]; a[j] = temp; } } } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++) import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++) temporary worker = a[i]; a[i] = a[j]; a[j] = temp; } } } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++) import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++) temporary worker = a[i]; a[i] = a[j]; a[j] = temp; } }
  • 7. } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++) import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++) temporary worker = a[i]; a[i] = a[j]; a[j] = temp; } } } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++) import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++) temporary worker = a[i]; a[i] = a[j]; a[j] = temp; } } } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++) import java.util.Scanner; public category Ascending _Order for (int i = 0; i < n; i++) temporary worker = a[i]; a[i] = a[j]; a[j] = temp; } } } System.out.print("Ascending Order:"); for (int i = 0; i < n - 1; i++)