In convert.py, define a function decimalToRep that returns the representation of an integer in a given base. The two arguments should be the integer and the base. • The function should return a string. • It should use a lookup table that associates integers with digits.
Q: procedure Algorithml(a1, 12, .., an: integers) for i = 2 to n a:=r+a, return r Suppose a list a, a2,...
A: Given Consider the following psendocode for an algorithm called "Algorithm!", which reads procedure ...
Q: ExampleProg PROG_START; One := 1; Two := 2; Five := 5; OneFive := One + Five / Two; Write ( OneFive ...
A: Given code is PROG_START; One := 1; Two := 2; Five := 5; OneFive : One + Five / Two; Write (OneFive...
Q: Construct dfas that accept the followings: a. Set of all strings on {0,1} that do not contain two co...
A:
Q: Python Big-O Coding pls answer only if u know Big-O!! Note for correct answers: Fi...
A: T(a,n)=T(aT(n/b) + o(a(n)) T(x,y)=2T(n/2)+O(1)
Q: What does the following code display? int [] arr2 = {1, 2, 3}; for (int i = 0; i < arr2.length; i++)...
A: Answer
Q: at's why we now have 64-bit computers, which as of 2019 are the standard. 1. The main use of bytes (...
A: The answer of the following is provided below.
Q: Let R1 and R2 be the relations on {1, 2, 3, 4} given by R, = {(1,1), (1,2), (3,4), (4,2)} R, = {(1,1...
A: answer - (i) Given: R1 = {(1,1),(1,2),(3,4),(4,2)} R2 = {(1,1),(2,1),(3,1),(4,4),(2,2)} Therefore R1...
Q: 8. Create a flowchart that will input for the celsius and concert it to degrees fahrenheit.
A:
Q: 3. In this c++ program. Create a flowchart and algorithm
A: The above Program is to find the largest number among 3 numbers Im considering 3 numbers as A B C
Q: Build an application that shows the use of a TableView and the navigation. The app should implement ...
A: According to the question, we have to Build an application that shows the use of a TableView and the...
Q: What is it about zero-day exploits that makes them so dangerous?
A: A zero-day exploit is a software security weakness that the programmed manufacturer is aware of but ...
Q: 1. When will a man becom 2. How do you derive your 3. When does masculinity
A: NOTE: ACCORDING TO COMPANY POLICY WE CAN SOLVE ONLY 1 QUESTION. YOU CAN RESUBMIT THE QUESTION AGAIN ...
Q: What exactly is "invalid data"?
A: Introduction: Data validation is the process of checking the correctness and consistency of data fro...
Q: What is the difference between a UNIQUE and a PRIMARY KEY constraint? (See the tables in the JustLee...
A: Introduction: When creating a table, a primary key is used to identify each row in the table, while ...
Q: Museum Visitor app Deliverable #5 Brainstorm with your team to develop a set of Class respon...
A: To reffer use case diagram is below
Q: I need a C code of this: Input 1. Number of rows Constraints The value is guaranteed to be >= 3...
A: Please refer full code with output screenshot: #include<stdio.h> int main() { int r,...
Q: Explain the distinctions between an inclusive cache and an exclusive cache
A: Cache that is both inclusive and exclusive Cache coherence is made easier with an inclusive cache.
Q: Which sort algorithm is the following code implementing? int out, car, key; for(car = 1; car = 0) &&...
A: here we have to find which sort algorithm is the given code implementing:- Code Given To Us:- int ou...
Q: mips program equivalent to this function
A: Here we have to write the mips program equivalent to given c program
Q: What good is a Master file containing largely long-term data?
A: A master file is a collection of data (such as names, dates, and so on) that may be used to generate...
Q: Describe the functioning of a transparent latch.
A: Data storing is important when we want to store it permanantly.
Q: 1. What is method Overloading? Which of the below code contains correct overloading code? Why would ...
A: Method Overloading: In this, if a class has the multiple methods which will having the same name but...
Q: What is the difference between a UNIQUE and a PRIMARY KEY constraint? (See the tables in the JustLee...
A: Introduction: The primary key is the column in a table that identifies each row in that table by its...
Q: The topic is Newton method from Numerical Methods. Task: Create a program that uses C language that ...
A: Code: #include<stdio.h>#define EPSILON 0.001#include <stdlib.h>#include <math.h> d...
Q: unding?
A: NOTE: ACCORDING TO COMPANY POLICY WE CAN SOLVE ONLY 1 QUESTION. YOU CAN RESUBMIT THE QUESTION AGAIN ...
Q: Which of the two caches is faster, the L1 or the L2? Which is the smaller of the two? What is the re...
A: Introduction: L1 cache is more minor than L2 cache due to L1's faster-processing speed. The processi...
Q: Which of the following questions about comparing and ranking categories is best answered by a bar ch...
A: The correct option is 'd'
Q: describe how the current technology in use assists the use of the knowledge, information and data an...
A: Introduction: Technology facilitates the use of knowledge in a variety of ways. It allows kids to st...
Q: Implement a function create_grade_list() with a string parameter representing space-separated grades...
A: The code creates a list of grades. The code then iterates through the grade_info and creates a new...
Q: SOLVE RECURRENCE USING THE TREE METHOD (NOT MASTER METHOD) : (I need to solve for " i " and show...
A: a) T(n) =2T(n/2)+C , The recurrence tree is
Q: What types of notifications can you set your network monitor to send to IT employees when specific, ...
A: We can set up three different sorts of alerts and network notifications. Real-Time Alerts Intellig...
Q: site scr
A: Explanation: An attacker injects malicious executable scripts into the code of a trusted applicatio...
Q: The following sentence is a theorem of truth functional logic. (P → (Q → (P ∧ Q))) (a) Explain i...
A: The following sentence is a theorem of truth functional logic. (P → (Q → (P ∧ Q))) (a) Explain in ...
Q: mean when you say
A: When an EC2 instance is stopped: When an EC2 instance is shutdown and cannot be used, then it is in ...
Q: #include using namespace std; int main() { int i, n; bool is_prime = true; cout > n; //...
A: Prime number is a number that is greater than 1 and divided by 1 or itself. In other words, prime nu...
Q: One of the advantages of a pie chart is that it shows that the total of all the categories of the pi...
A: According to the question the best pie chart only create when you add up to the 5-6 category only do...
Q: mputes and returns the smallest positive integer n for which 1+2+3+...+n equals or exceeds the value...
A: Lets see the solution.
Q: Question 3: Simulate Topological sort on the graph below. Show each step clearly. Show the sorted or...
A: Solution:
Q: Write a program that reads two integers as input, and outputs the first integer and subsequent incre...
A: The Answer is
Q: Create a c++ program to swap the values of two variables entered by user then display the swapped va...
A: As per the requirement program has completed. Algorithm Step 1: Write the main() method Step 2: Rece...
Q: Prompt When you use WiFi at home to connect to the internet, you should know that all the internet-...
A: Proxy means ‘in place of’, representing’ or ‘in place of’ or ‘on behalf of’ are literal meanings of ...
Q: Write a Python program to get the geometric mean of n numbers. Take the n numbers from the user.
A: Required:- Write a Python program to get the geometric mean of n numbers.Take the n numbers from the...
Q: Compare and contrast the advantages and disadvantages of using pagers.
A: Your answer is given below in detail. Introduction :- When someone tries to contact you, a pager i...
Q: If the data were collected as a function of time at regular intervals, what operator should be used ...
A: If the data were collected as a function of time at regular intervals, what operator should be used ...
Q: Use myObj to access and print the value of the x attribute of MyClass. public class MyClass { int x ...
A: Introduction: PROGRAMMING LANGUAGE: Java Use myObj to access and print the value of the x attribute...
Q: NEED IT IN VECTORS, NOT ARRAYS Implement InsertionSort function either iteratively or recursively: ...
A: ITERATIVE INSERTION SORT: Program code: // C++ program to implement insertion sort using STL.#incl...
Q: Use 8 bits to represent the decimal number -59 in 2's complement form. A 11000101 11011001 10101100 ...
A: 8 bit representation of decimal number -59 in 2's complement form: Step-1) Start with the positive v...
Q: Find the simplified SOP expression for F(V,W,X,Y,Z)=summation of MAXTERMS (2,3,4,7,10,11,13,16,18,19...
A: From the given MAXTERMS the minterms are (0,1,5,6,8,9,12,14,15,17,20,21,22,25,28,30) The K-Map is:
Q: What does an ordinary differential equation contain? Group of answer choices independent variable de...
A: An ordinary differential equation is a differential equation containing one or more functions of...
Must be written in Python.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Mark the following statements as true or false: a. To use a predefined function in a program, you need to know only the name of the function and how to use it. (1) b. A value-returning function returns only one value. (2, 3) c. Parameters allow you to use different values each time the function is called. (2, 7, 9) d. When a return statement executes in a user-defined function, the function immediately exits. (3, 4) e. A value-returning function returns only integer values. (4) f. A variable name cannot be passed to a value parameter. (3, 6) g. If a C++ function does not use parameters, parentheses around the empty parameter list are still required. (2, 3, 6) h. In C + + , the names of the corresponding formal and actual parameters must be the same. (3, 4, 6) i. A function that changes the value of a reference parameter also changes the value of the actual parameter. (7) j. Whenever the value of a reference parameter changes, the value of the actual parameter changes. (7) k. In C++, function definitions can be nested; that is, the definition of one function can be enclosed in the body of another function. (9) l. Using global variables in a program is a better programming style than using local variables, because extra variables can be avoided. (10) m. In a program, global constants are as dangerous as global variables. (10) n. The memory for a static variable remains allocated between function calls. (11)(Numerical) a. The following is an extremely useful programming algorithm for rounding a real number to n decimal places: Step 1: Multiply the number by 10n Step 2: Add 0.5 Step 3: Delete the fractional part of the result Step 4: Divide by 10n For example, using this algorithm to round the number 78.374625 to three decimal places yields: Step1:78.374625103=78374.625 Step2:78374.625+0.5=78375.125 Step3:Retainingtheintegerpart=78375Step4:78375dividedby103=78.375 Using this algorithm, write a C++ function that accepts a user-entered value and returns the result rounded to two decimal places. b. Enter, compile, and run the program written for Exercise 11a.(Numerical) Heron’s formula for the area, A, of a triangle with sides of length a, b, and c is A=s(sa)(sb)(sc) where s=(a+b+c)2 Write, test, and execute a function that accepts the values of a, b, and c as parameters from a calling function, and then calculates the values of sand[s(sa)(sb)(sc)]. If this quantity is positive, the function calculates A. If the quantity is negative, a, b, and c do not form a triangle, and the function should set A=1. The value of A should be returned by the function.
- (Numerical) Write a program that tests the effectiveness of the rand() library function. Start by initializing 10 counters to 0, and then generate a large number of pseudorandom integers between 0 and 9. Each time a 0 occurs, increment the variable you have designated as the zero counter; when a 1 occurs, increment the counter variable that’s keeping count of the 1s that occur; and so on. Finally, display the number of 0s, 1s, 2s, and so on that occurred and the percentage of the time they occurred.//-In python-// def compute_stats():"""Write a function compute_stats, such that given a string of grades as an input parameter,it calls the function get_new_grades (defined in theprevious question) and returns a tuple that containsthe average value of the initial grades andthe average value after running the get_new_grades function.""" pass The code should aslo have if __name__ == "__main__" section.1. Square Flower You can have the turtle draw an interesting flower like sha pe by drawing n squares. Each n-square flower is drawn after turning the turtle by some number of degrees between each square. (see Figure 1 for an example) (a) Typel: A 5-square red flower. (b) A 15-square blue flower. Figure 1: Two types of n-square flowers Using the following implementation of draw square() function write a function na med draw flower() that takes a turtle, the number n of squares to draw, the side length and a color as parameters and draws an n-square flower by repeating the function draw square() n times. Test your code by drawing a yellow 21-square flower with side length of 200. def drav aqu ar e (aTurtle, sidelength): f or i in range (4) : aTurtle.forvard (side Length) aTurtle. 1eft (90)
- in C++ program please: part a) According to Wikipedia: “The International Collegiate Programming Contest, known as the ICPC, is an annual multi-tiered competitive programming competition among the universities of the world.” Moreover, the participants of the contest should be no older than 24. Complete the following function which takes as input two parameters: the current year and the birth year of a student. The function should return the age of the person given the parameters. int calculateAge(int current_year, int birth_year) { part b) The teacher wants to determine if a group of students is eligible for this competition. Complete the following piece of code considering that the age of these students are stored in the studentsAge array and use the calculateAge function to determine the eligibility. Note: solution should use calculateAge ! int main() { int studentsAge[10]; #your answer for (int i = 0; i < 10; i++) { cin >> studentsAge[i]; # your answer Your program…in C++ program please: part a) According to Wikipedia: “The International Collegiate Programming Contest, known as the ICPC, is an annual multi-tiered competitive programming competition among the universities of the world.” Moreover, the participants of the contest should be no older than 24. Complete the following function which takes as input two parameters: the current year and the birth year of a student. The function should return the age of the person given the parameters. int calculateAge(int current_year, int birth_year) { part b) The teacher wants to determine if a group of students is eligible for this competition. Complete the following piece of code considering that the age of these students are stored in the studentsAge array and use the calculateAge function to determine the eligibility. Note: solution should use calculateAge ! int main() { int studentsAge[10]; #your answer for (int i = 0; i < 10; i++) { cin >> studentsAge[i]; # your answer Your program…void fx(char ch) is a function with no return value int fx(char x) is a function with int return value int fx(char &x) is a function with parameter passed by value char fx( int x) is a function with int return value
- python nMath: pentagonal numbers) A pentagonal number is defined as n(3n-1)/2 for n=1,2,..., and so on. So, the first few numbers are 1, 5, 12, 22, .... Write a function with the following header that returns a pentagonal number: def getPentagonalNumber(n): Write a test program that uses this function to display the first 100 pentagonal numbers with 10 numbers on each line.// In python // def compute_stats():"""Write a function compute_stats, such that given a string of grades as an input parameter,it calls the function get_new_grades (defined in theprevious question) and returns a tuple that containsthe average value of the initial grades andthe average value after running the get_new_grades function.""" passinteger) Write a function that computes the sum of the digits in an integer. Use the following function header:def sumDigits(n):For example, sumDigits(234) returns 9 (Hint: Use the % operator to extract digits, and the // operator to remove the extracted digit. For instance, toextract 4 from 234, use 234 % 10 To remove 4 from 234, use 234 // 10 (=23) Use a loop to repeatedly extract and remove the digits until all the digits are extracted.) Write a test program that prompts the user to enter an integer and displays the sum of all its digits.