1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zalisa [80]
3 years ago
6

Write a complete c++ program using function and array.​

Computers and Technology
1 answer:
lana66690 [7]3 years ago
8 0

Answer:

Index Value Hash

0 1 $

1 2 $$

2 3 $$$

3 4 $$$$

4 5 $$$$$

Explanation:

You might be interested in
Write a MIPS assembly language program that accomplishes the following tasks:The program will prompt the user to enter an intege
Svetlanka [38]

Answer:

Here's the code below

Explanation:

# All the comment will start with #

# MIPS is assembly language program.

# we store the all the data inside .data

.data:

k: .asciiz "Enter the kth value:\n"

.text

.globl main

li $s0, 0 # $s0 = 0

li $t0, 0 # $t0 = 0

la $n0, k # $n0 is kth value address

syscall # call print_string()

li $v0, 0 # $v0

syscall

move $n0, $v0 # $a0 = user input or "int n"

addi $sp, $sp, -4 # move the stack pointer down

sw $ra, 0 ($sp) # save the return address for main

jal fncheck # call fncheck(n);

fncheck:

beq $n, 0, fnfirst #if n==0 then fnfirst

beq $n, 0, fnfirst #if n==0 then fnfirst

ble $n0, 5, fnrec # if (n <=5) then 5

bge $n0, 5, fnjoke

#first function for n 0 and 1

fnfirst:

li $t0, 0 # initialize $t0 = 0

addi $t0, $t0, 20 # $t0 = 20

move $v0, $t0 # return 20

jr $ra

#function to execute 5*function1(n-2) + n;

fnrec:

sub $sp, $sp, 12 # store 3 registers

sw $ra, 0($sp) # $ra is the first register

sw $n0, 4($sp) # $n0 is the second register

addi $n0, $n0, -2 # $a0 = n - 2

jal function1

sw $v0, 8($sp) # store $v0, the 3rd register to be stored

lw $n0, 4($sp) # retrieve original value of n

lw $t0, 8($sp) # retrieve first function result (function1 (n-2))

mul $t0, $t0, 5 # $t0 = 5 * function1(n-2)

add $v0, $v0, $t0

lw $ra, 0($sp) # retrieve return address

addi $sp, $sp, 12

jr $ra

#function to print joke

fnjoke:

la "Joke section"

4 0
3 years ago
Choose the correct item. Check your answers in the text.<br>3​
RSB [31]

Answer:

You should do that

Explanation:

You didnt say anything

5 0
3 years ago
Which of theses is NOT one of the standard Text filters in Excel 2013?<br><br>​
aalyn [17]

Yes, it is possible to move a worksheet to open another workbook but not to copy it there. Explanation: Microsoft Excel is a powerful tool for organizing work or business-related things etc.

6 0
2 years ago
A device that modulates digital data onto an analog signal and then demodulates the analog signal back to digital data is a ____
LenKa [72]
A modem. (From modulator-demodulator)
5 0
3 years ago
Which technology can be used as a defense against dos and ddos syn flood attacks?
Montano1993 [528]
In terms of websites, there's a service called cloud flare which can prevent DDOS attacks in websites. Other applications you would have to look up. Hopefully this helps!
6 0
3 years ago
Other questions:
  • Some files appear dimmed in one of the default folders on your computer. What would be the best course of action? A. Leave the f
    11·1 answer
  • Hanging out with friends, watching your favorite TV show, and buying a pair of new shoes are all examples of _____ for doing wel
    5·2 answers
  • Easy STEAM question :)
    15·2 answers
  • to the nearest millimeter a cell phone is 123 long and 54 mm wide what is the ratio of width to length
    12·1 answer
  • How should you set the OHMS ADJust control on a multitester of analog VOM, for resistance measurements?
    12·1 answer
  • This project involves writing a program that encodes and decodes messages. The program should prompt the user to select whether
    15·1 answer
  • The stub: transmits the message to the server where the server side stub receives the message and invokes procedure on the serve
    8·1 answer
  • IF ANYONE ANSWERS YOUR QUESTION WITH SOMETHING LIKE THIS:
    10·2 answers
  • Describe some things that this person might say that might cause you to NOT hire them. Explain.
    6·1 answer
  • What Is The First Computer Brought In Nepal ? <br>​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!