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
nordsb [41]
3 years ago
9

Assume that you have implemented a sequence class. Describe the mySequence object (i.e., items with the correct order and the po

sition of the current index) after each line of the following code
sequence mySequence;
mySequence.insert(3)
mySequence.insert(2);
mySequence.attach(10);
mySequece.advance();
mySequence.attach(11);
mySequence.insert(4);
mySequence.insert(6);
mySequece.advance();
mySequence.remove_current();
mySequence.insert(9);
Computers and Technology
1 answer:
djyliett [7]3 years ago
7 0

Answer:

The final sequence is:  2 10 3 6 9(c) 11

Explanation:

The first line of code creates the sequence object "mySequence". Every insert() method inserts the item before the current item to make a new current item. The attach() method adds a new current item after the previous current item. The advance() method makes the next item to the current item the new current item.

The remove_current method of the sequence object removes the current item of the sequence.

You might be interested in
For angular how can we set up th edatabse.
lesya [120]
You can not communicate directly between Angular and MySQL. You'll need to build a back-end Web service that calls MySql using php or node. Angular can communicate with this back-end Web service via http.
8 0
3 years ago
Select the correct answer. Which character type is usually seen more often in games for young children than for the other age gr
garri49 [273]

Answer:

B. Animal

Explanation:

Just took the test on Plato

#PlatoLivesMatter

7 0
3 years ago
Create a new file that builds a shopping list from a user. There should be a input query that asks the user to list an item and
levacccp [35]

Answer:

Check the output

Explanation:

# -*- coding: utf-8 -*-

"""

Created on Thu Apr 12 00:39:11 2018

author:

"""

stocks ={

       "tomato soup": 20,

       "cheese": 8,

       "bread": 6,

       "milk": 8,

       "butter": 7,

       "coffee": 8,

       "ice cream": 5,

       "orange juice": 12,

       "bacon": 6,

       "tortilla chips": 14,

       "ramen": 24 }

prices ={

       "tomato soup": 1.85,

       "cheese": 3.99,

       "bread": 2.50,

       "milk": 3.59,

       "butter": 1.99,

       "coffee": 5.99,

       "ice cream": 2.99,

       "orange juice": 2.50,

       "bacon": 5.49,

       "tortilla chips": 3.00,

       "ramen": 0.99 }

def grocery_cost(item_list,quantity_list):

   totalcost = 0

   for i in range(len(item_list)):

       totalcost=totalcost+(quantity_list[i]*prices[item_list[i]])

       

   return totalcost

def stock(item):

   print("Number of itmes present in the stock:",stocks[item])

print("Welcome to the on-line grocery store!!")

print("Items that are available for purchase:")

for key in stocks.keys():

   print(key)

#chosen foods

print("Enter the item with quantity or Enter 'Q' when you are done")

item_list=[]

quantity_list=[]

while True:

   item=input('Enter the item name: ')

   if item=='Q' or item=='q':

       break

   item_list.append(item)

   while True:

       quan=int(input('Enter the number of item: '))

       if stocks[item] >=quan:

           quantity_list.append(quan)

           break

       else:

           stock(item)

           print('Your requirement is higher than stock available. Please enter again!!')

print("\nTotal cost:", "$",grocery_cost(item_list,quantity_list))

Kindly check the output in the attached image below.

7 0
3 years ago
The 169.254.78.9 ip address is an example of what type of ip address
scoundrel [369]
As specified in RFC5735, this is an address from the "link local" block. It is assigned to a network interface as a temporary address, for instance if no static address is configured and the DHCP server is not found.

If you boot your PC without a network cable, you'll probably end up with a 169.254.*.* address.
8 0
3 years ago
In the code below, what's the final value of the variable x?
Lana71 [14]

Answer:

First equation x=4

second equation x=3

Explanation:

The question is telling us that 'X' is equal to 8. It's another way of representing this number using X as the variable replacing it.

We input 8 instead of the X to solve the equation, and here in the picture, you can see where I went from there.

Do the same thing for the other equation.

I hope this helps :)

3 0
3 years ago
Other questions:
  • In the software development life cycle, what is the role of participants in the planning phase? The participants’ role in the pl
    6·1 answer
  • What can use so tha the slides can appear?
    13·1 answer
  • Write a program that asks the user to enter the amount s/he has budgeted for a month. The amount should be between 1000 and 2000
    11·1 answer
  • You are evaluating the bounce rate of your overall website traffic and find that users with a social media referral source have
    9·1 answer
  • Which one is correct
    8·1 answer
  • How do you know where the home row of the keyboard is?
    14·2 answers
  • It's a holiday poop in my bitt
    10·2 answers
  • Easy<br> What is your favorite Anime<br> Mine is Attack On Titan at the moment
    7·2 answers
  • If you do not clean your hardware on a regular basis, which of these is most likely to be a problem?
    11·1 answer
  • Describe s computer network that you are familiar with ?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!