Analyze the code below: dogs ["KK", "Cyber", "Blake", "Pinky", "Taki", "Chubby"] a = len (dogs) b= dogs index("Pinky") C = dogs.index("Blake") What will be the value of a? a. 6. b. 2 C. 3 d. 5
Q: #BABY DAYCARE PROGRAM def getTallest (name, height): n = len (name) large = height[0] for i in range…
A: According to the given instruction I have create a list age[] to store the age of the babies. And…
Q: 6- How to make a C++ function work with multiple data types? C++ 7- Every class has a default copy…
A: Make use of multiple data type in C++ functions As per our policies we will answer only 1st…
Q: Hi, I am implementing a matrox with several functions. I have pasted the error, the assignment and…
A: class Matrix: def __init__(self, rows): self.list1 = rows def __str__(self):…
Q: Write a program that generates a gradebook similar to the jenzabar grade book output: student name…
A: Note, as you haven't provided any programming language in the question so, I am using python…
Q: What will the following code display?
A: Given data:- What will the following code display?
Q: def get_volume (width, height, length=2): volume = width * height * length return volume def main…
A: def get_volume (width , height , length=2): volume = width * height *length return…
Q: Write a function in c++ that will receive a pointer to the address of the first element of the array
A: The C++ program is written where the input will be taken from the user and will store in the array.…
Q: Identify the errors in the following program segment and describe how to correct them. You can…
A: Given: FloatProperty f=new FloatProperty(1.0); FloatProperty f2=new FloatProperty(2.0);…
Q: 8.27 LAB: Scrabble points Scrabble is a word game in which words are constructed from letter tiles,…
A: Here is the code for the following score = {"a": 1, "c": 3, "b": 3, "e": 1, "d": 2, "g": 2,…
Q: What happens if you add 4 to ptr, assuming it is a reference to an int?
A: Given: The Addition of an Integer to the Solution Pointers make it possible for two arithmetic…
Q: Can you help me with the codes required for this assignment? the programming langauge is Java.…
A: Program code: //import the required packages import java.util.Scanner; //define the class Exercise…
Q: Look at the following declaration:enum Flower { Rose, Daisy, Petunia } In memory, what value will be…
A:
Q: USE THE PROGRAM CODE BELOW TO CODE 1. COMMAND LINE ARGS CODE IN JAVA 1. Command Line Args…
A: Hello student, hope you are doign good. In this question, the program needs to be modified such…
Q: Below is the code to convert an infix expression to postfix and then evaluate that expression, it…
A: C++ is an object-oriented programming language, it will be used to build web browser applications…
Q: Assume pointer P points to object of class1 and pointer Q points to object of class2, one of the…
A: Assume pointer P points to object of class1 and pointer Q points to object of class2 one of the…
Q: n C++, using STL algorithms, containers, or iterators, use the text file shoes.txt, where you want…
A: code #include<bits/stdc++.h> using namespace std; int main(){ string shoes; char…
Q: 9. Write a function to deal a hand of five cards from the deck. The function should accept a…
A: Code in Step 2:
Q: Q3: Write the constructor's headers of the followings? new Student (202101156, "Ahmed"); new…
A: let's make constructor's header
Q: ow to write C++ program that reads a list of nine digit number from the keyboard. It stores the…
A: According to the question we have to write a C++ program that reads a list of nine-digit numbers…
Q: In C In this problem, you will recreate one of the truly great moments in history, namely the…
A: Approach: include necessary header files declare methods called as void moveTortoise( )and void…
Q: 4) In each below, a segment of Java code is given. Draw a picture that shows the final result of the…
A: Linked List: A linked list is a linear data structure that is basically a collection of nodes. These…
Q: Create a class “name” with two data members: one for the first name (String) and one for the surname…
A: #include<iostream> #include<string> using namespace std; A) class name{ pubic:…
Q: Write a program in C language that accepts integers as command-line arguments. The number of…
A:
Q: Create an iterator that returns numbers, starting with 1, and each sequence will increase by one…
A: Solution in C++- #include <iostream>using namespace std;void interater(){ for (int i =1;…
Q: What is void pointer? Give Example code ?
A: As you have not specified in which language you want the code, therefore the example code in the…
Q: #in c++ We need to store information about each student in a class of N students. For example, name,…
A: PROGRAM EXPLANATION: The algorithm for creating the program with given description is as follows:…
Q: def thing2(lst: List[int]) -> None: """TODO: Enter your description of the runtime complexity of…
A: Time Complexity - Time complexity is used to measure computer time taken by algorithm/program, Ou…
Q: C++ Create a Blackjack (21) game. Your version of the game will imagine only a SINGLE suit of…
A: Answer :
Q: Question 1 Write a program in C that takes two integers, M and N, as command line arguments and then…
A: Algorithm: for (int i = 0; i < M; i++) { for (int j = 0; j < N; j++) {…
Q: 2) #include struct uu 11 8 5 8 11 11 5 15 int x; struct uu *p; }; struct uu fun(struct uu d) d.x *=…
A: Structure: It is similar to class. It holds the variable of different data types under the same…
Q: that reads a line of text, tokenizes the line using space characters as delimiters and outputs only…
A: Code: import java.util.*; class Main { public static void main(String[] args) { Scanner in=new…
Q: Please help with this c++ problem Assignment 6 - Monkey Food In the Gaddis textbook read Chapter…
A: The Answer is in step-2.
Q: Write a complete C# console application in which you will have to store data of Employee in 1…
A: Program plan:- Create an employee array. Call functions. Function to input employee details. Method…
Q: ou are said to store data of Hospitals in a city. For that purpose, you are asked to develop a…
A: You are said to store data of Hospitals in a city. For that purpose, you are asked to develop a…
Q: What would be the result of following R code?
A: dim() Function in R: In the R programming language, the dim() returns the dimension of the given…
Q: 1. You only want to watch low calorie food. Write the following function: def low_cal(foods, count)…
A: Python used to answer this question
Q: Command Line Arguments
A: We can provide 2 command line arguments in double format and use Double.parseDouble for parsing the…
Q: LEASE ANSWER IN C++ Begin by writing a Student class. The public section has the following methods:…
A: Vector in CPP : Vectors are same as powerful clusters with the capacity to resize itself…
Q: # Write python codes here. print("Total E-Customer:", ECustomer.count) c1 = ECustomer("James")…
A: Here I have created a class named ECustomer.In this class, I have created a static variable named…
Q: // Assume all libraries are included void func(int a, // int main () { int i = 5, j = 4, k = 3; 3…
A: in func variable a is taken by value but b and c are taken by reference. so, whatever changes made…
Q: Write a console application with several functions that deal with a two-dimensional array of…
A: #include<iostream>#include<time.h>#include<stdlib.h>using namespace std; bool…
Q: Write a code for craps game. Craps is a dice game in which the players make wagers on the outcome of…
A: GIVEN The rules of the dice game craps are as follows: You roll two dice. Each die has six faces,…
Q: What do the keywords virtual and override do in C++?
A: Function overriding is redefinition of base class work in its inferred class with same mark i.e…
Q: Print person1's kids, apply the IncNumKids() function, and print again, outputting text as below.…
A: PROGRAM CODE: #include <iostream>using namespace std;/* Print person1's kids, apply the…
Q: 8.27 LAB: Scrabble points Scrabble is a word game in which words are constructed from letter tiles,…
A: The answer given as below:
Q: Is there any inbuilt function in JAVA that takes two arrays as the parameters and returns true if…
A: Check if there is an inbuilt function in JAVA that takes two arrays as the parameters and returns…
Q: Create an iterator that returns numbers, starting with 1, and each sequence will increase by one…
A: here in the given question ask for a program in python ,in that requirement is create an iterator…
Q: Write definition of search, isItemAtEqual, retrieve, remove, print, constructor, and destructor for…
A: search(k) : Keep probing until the slot's key doesn't become equal to k or an empty slot is…
Q: Analyze the following code and fill in the output. # Employee List name - ["Joe","Janice", "Ahmed",…
A: The output is : Joe worked 40 at 17.55 making 702 Janice worked 42 at 12.35 making 1683 Ahmed worked…
Step by step
Solved in 2 steps
- Dont post from internet. Which type of polymorphism is depicted in the following code? void PlayerName(string Coach) { cout << "In the team since " << Coach << endl; } void PlayerName(Coach Coach) { cout << "In the team since " << Coach.GetDetails() << endl; } void PlayerName(Players* playerPtr) { cout << "In the team since " << playerPtr->GetDetails() << endl; } int main() { vector<Players*> memberList; Players* playerPtr; Coach* coachPtr; memberList.push_back(playerPtr); memberList.push_back(coachPtr); for (int i = 0; i < memberList.size(); ++i) { PlayerName(memberList.at(i)); } } 1)Static 2)Runtime 3)No polymorphism 4)Compile-time.Using Dr-Racket, what is the purpose of the number function?(define (number n)(local [(define (abstract int)(* int 11))] (build-list n abstract))) A) Create a list of the first n multiples of 11 starting at 11. B) Create a list of the first n multiples of 11 starting at 0. C) Create a list of the first n multiples of 11 starting at 1. D) Create a list of the first 11 multiples of n starting at 1. E) Create a list of the first 11 multiples of n starting at 0.F) Create a list of the first 11 multiples of n starting at n.Please, I want to modify the code so that the user can add the employee's name, number and specialization, and use for loob He must add more than one employee. When he finishes adding the employee’s data, he asks the user: Do you want 1-Print the data 2-Add a new employee 3-Exit class Doctor:"""Represents a Doctor""" #initializer with specialization default to "general"def __init__(self, Id, name, specialization="general"):#attributesself.Id = Idself.name = nameself.specialization = specialization.lower() #initializing salary to 25000, basic salaryself.salary = 25000 #incrementing salary based on specialization#if specialization is pediatric, increasing salary by 10%if specialization == "pediatric":self.salary += self.salary*10/100 #if specialization is dental, increasing salary by 15%elif specialization == "dental":self.salary += self.salary*15/100 #str() functiondef __str__(self):return (f"Id: {self.Id} \n"f"Name: {self.name} \n"f"Specialization: {self.specialization} \n"f"Salary:…
- Question: Change this code in java just with changing abstraction and exception handling #include <stdio.h>#include <string.h>#include <stdlib.h> typedef struct Guests{char name[50];int status;int nights;float room_cost;float srv;float cost;} G; void options(G guest[]){int option;printf("\n\nMenu\n-----------\n");printf("1. Check in\n");printf("2. Services\n");printf("3. Invoice\n");;printf("4. Check out\n");printf("5. Exit\n");printf("\nPlease Choose a Number According to the Option: ");scanf("%d", &option);switch(option){case 1:printf("\nCheck in\n-----------\n");check_in(guest);break; case 3:printf("\nInvoice\n-----------\n");invoice(guest);break; case 2:printf("\nRequest\n-----------\n");request(guest);break; case 4:printf("\nCheck out\n-----------\n");check_out(guest);break; case 5:exit(0);break;}} void check_in(G guest[]){int i, choice, nights;printf("Rooms:\n\n");for(i=0;i<4;i++){printf("Room No.%d\n", i+1);printf("Room Cost: %.2f/night\n",…INT_MIN = -32767 def cut_rod(price): """ Returns the best obtainable price for a rod of length n and price[] as prices of different pieces """ n = len(price) val = [0]*(n+1) # Build the table val[] in bottom up manner and return # the last entry from the table for i in range(1, n+1): max_val = INT_MIN for j in range(i): max_val = max(max_val, price[j] + val[i-j-1]) val[i] = max_val return val[n] # Driver program to test above functionsarr = [1, 5, 8, 9, 10, 17, 17, 20].do some changes in code and make it unique #include <stdio.h>#include <stdlib.h>#include<string.h>//declaring functionsvoid firstFit(int [], int , int [],int );void bestFit(int [], int , int [],int );void worstFit(int [], int , int [],int );//starting programint main() {//declare partitions and processint partitions [] = {110, 450, 100, 250, 500};int processes [] = {212, 417, 112, 426};//getting their sizesint size_partitions = sizeof(partitions )/sizeof(partitions [0]);int size_processes = sizeof(processes )/sizeof(processes [0]);printf("Partitions size: ") ;for (int i=0; i<size_partitions; i++){printf("%d\t" ,partitions[i] );}//index partprintf("\nPartitions index: " );for (int i=0; i<size_partitions; i++){printf("%d\t" ,(i+1)) ;}printf( "\n" );// calling functionsfirstFit(partitions , size_partitions, processes , size_processes);bestFit(partitions , size_partitions, processes , size_processes);worstFit(partitions , size_partitions, processes ,…
- write a python code named get_total_cases() takes the a 2D-list (similar to database) and an integer x from this set {0, 1, 2} as input parameters. Here, 0 represents Case_Reported_Date, 1 represents Age_Group and 2 represents Client_Gender (these are the fields on the header row, the integer value represents the index of each of these fields on that row). This function computes the total number of reported cases for each instance of x in the text file, and it stores this information in a dictionary in this form {an_instance_of_x : total_case}. Finally, it returns the dictionary and the total number of all reported cases saved in this dictionary. (Suppose we want to know the total number of cases reported on each date, so use x = 0.) >>> result, total_cases = get_total_cases(database, 0) >>> display_dict(result) 2021-05-19: 8 2021-05-20: 2 2021-05-21: 1 2021-05-22: 1 >>> print(total_cases)Q1 #include <stdio.h> int arrC[10] = {0}; int bSearch(int arr[], int l, int h, int key); int *joinArray(int arrA[], int arrB[]) { int j = 0; if ((arrB[0] + arrB[4]) % 5 == 0) { arrB[0] = 0; arrB[4] = 0; } for (int i = 0; i < 5; i++) { arrC[j++] = arrA[i]; if (arrB[i] == 0 || (bSearch(arrA, 0, 5, arrB[i]) != -1)) { continue; } else arrC[j++] = arrB[i]; } for (int i = 0; i < j; i++) { int temp; for (int k = i + 1; k < j; k++) { if (arrC[i] > arrC[k]) { temp = arrC[i]; arrC[i] = arrC[k]; arrC[k] = temp; } } } for (int i = 0; i < j; i++) { printf("%d ", arrC[i]); } return arrC; } int bSearch(int arr[], int l, int h, int key) { if (h >= l) { int mid = l + (h - l) / 2; if…Need help making a java file that combines both linearSearch and binarySearch •Both search methods must use the Comparable<T> interface and the compareTo() method.•Your program must be able to handle different data types, i.e., use generics.•For binarySearch, if you decide to use a midpoint computation formula that is different fromthe textbook, explain that formula briefly as a comment within your code. //code from textbook //linearSearch public static <T> boolean linearSearch(T[] data, int min, int max, T target) { int index = min; boolean found = false; while (!found && index <= max) { found = data [index].equals(target); index++; } return found; } //binarySearch public static <T extends Comparable<T>> boolean binarySearch(T[] data, int min, int max, T target) { boolean found = false; int midpoint = (min + max)/2; if (data[midpoint].compareTo(target)==0)…
- TODO 1 Obtain all the indexes with labels equal 2 with np.where and the label array y. Keep the results in two_class_idx also index np.where() at 0 # TODO 1.1 two_class_idx = print(f"two_class_idx output: \n {two_class_idx}") try: print(f"two_class_idx shape: {two_class_idx.shape}") except Exception: pass todo_check([ (isinstance(two_class_idx, np.ndarray),f'two_class_idx is not an NumPy array! two_class_idx is currently a {type(two_class_idx)}'), (np.all(two_class_idx == np.array([3,9,11,12,16])),'two_class_idx does not contain the correct location values') ])Program this in java the state and variable display must be:Unsorted Partition Reference Index: 0, Traversing Index: 7, Current Traversing Index Value: mango, Next Index Value: plum, Swapping Condition: FalseCurrent Array: ['apple', 'avocado', 'orange', 'banana', 'strawberry', 'pineapple', 'plum', 'mango'] The input:["apple", "avocado", "orange", "banana", "strawberry", "pineapple", "plum", "mango"]Note:The sorted partition is on the left side. Then, the order is increasing based on the number of vowels of a string.the output must be like this:['plum', 'apple', 'strawberry', 'mango', 'orange', 'banana', 'avocado', 'pineapple']In this final submission, you will build on checkpoint B to load the database and DNA sequence from files. There will be two databases and several sequences that will be available for download below. Example of the database is the file small.txt: name,AGATC,AATG,TATC Alice,2,8,3 Bob,4,1,5 Charlie,3,2,5 Example of the sequence is the file 1.txt: AAGGTAAGTTTAGAATATAAAAGGTGAGTTAAATAGAATAGGTTAAAATTAAAGGAGATCAGATCAGATCAGATCTATCTATCTATCTATCTATCAGAAAAGAGTAAATAGTTAAAGAGTAAGATATTGAATTAATGGAAAATATTGTTGGGGAAAGGAGGGATAGAAGG Implement/modify the following functions: Modify the function readData, which will now take an additional parameter: a string representing the filename containing the database of individuals and their STR counts. It will also return a bool indicating if opening the file was successful or not: bool readData(string filename, vector<string>& nameSTRs, vector<string>& nameIndividuals, vector<vector<int>>& STRcounts) Update the function…