(Geometry: area of a pentagon) Write a program that prompts the user to enter the length from the center of a pentagon to a vertex and computes the area of the pen- tagon, as shown in the following figure. 3√3 The formula for computing the area of a pentagon is Area = -s², where s is 2 TT the length of a side. The side can be computed using the formula s = 2r sin- where r is the length from the center of a pentagon to a vertex. Here is a sample run: Enter the length from the center to a vertex: 5.5 Enter The area of the pentagon is 108.61
Q: Q4. Write Insertion Sort algorithm to sort the following list of integer numbers. Show all the…
A: Insertion Sort: Insertion sort is a straightforward arranging algorithm that works like the manner…
Q: Mina always wants things to be sorted. She loves perfection in work and doesn't worry about time.…
A: Part A) For given scenario Quicksort is best . as it divide recursively array element with pivot…
Q: 1 - Write a C++ program that takes 10 Numbers from the user and sort them in decreasing order by…
A: Algorithm: STARTStep 1: Repeat Step 2 For i = 0 to NStep 2: Repeat For J = 0 to N - IStep 3: IF…
Q: Consider an online leisure club membership registration system in which users can register as…
A: Given we have a membership registration system now users can register as members which helps them to…
Q: Simply to minimum number of literals using Boolean Algebra. Answer both parts and show all steps.…
A: Here, we are given two Boolean functions and we are asked to simplify them using Boolean algebra. We…
Q: Q3) Write a program that converts the weather from Celsius to Fahrenheit in a specific day. The…
A: For representing the weather we use the various scales of temperature such as Celsius, Fahrenheit,…
Q: In the use of RSA Cryptography, if the public key under RSA Cryptography is (11, 65), find the…
A: Actually, given question regarding RSA Cryptography.
Q: Survey Data Analysis Computers are commonly used to compile and analyze the results of surveys and…
A: As per the requirements, the below program made using C language will input the 30 responses and…
Q: 1. (a) A periodic signal f(t) has a period To. Write the relationship between f(t) and To. (b) An…
A: The signal is said to be periodic if the signal shows definite patterns and repeats itself for…
Q: What are the three generations of advancement in wireless security that have taken place throughout…
A: Answer : The three generations of advancement in wireless security taken place throughout the time…
Q: A binary symmetric channel has a chance p = 0.002 of incorrectly transmitting a single bit. Let w…
A: The answer is
Q: Create a Sequence Diagram for car dealership.
A: Sequence Diagram: Because it illustrates the interactions between a group of items and the order in…
Q: my code is working but i want to remove all the processes from main and put them into a different…
A: A function is a set of statements used to solve a specific problem. C++ allows defining the function…
Q: Assume an interaction matrix with a minimum of 12 nodes. Demonstrate how the Kruskal algorithm can…
A: Kruskal’s Algorithm is used to find the minimum spanning trees. It treats every node as an…
Q: a. Find the subnet mask b. How many valid hosts are created?
A: The answer is
Q: write a program in c++ that contains declares a student_t data structure and defines functions to:*…
A: Introduction
Q: Proposition (Distributive Law): For expressions P1, P2, P3, any word matching the regular expression…
A: ANSWER:
Q: Write a python code that takes a string as an user input and finds out all the duplicate characters…
A: Python code: # defining method for creating shortestdef sort_string(n_list): # sorting list in…
Q: Suppose that you have measured the length of the side of a cube as (3.00±.005) meters. Give an…
A: Given side of the cube(x) =3.00 error = 0.005 dx=0.005 volume of the cube( v)=x^3…
Q: A sequence of n>0 integers is called a jolly jumper if the absolute values of the differences…
A: Answer: Here not mention any specific language use so we have done code in C++ programming language…
Q: 1. Convert the following • Convert hexadecimal value 22 to decimal • Convert binary 111111110010 to…
A: 1) (22)16 = 2*161 + 2*160 = 32 + 2 = (34)10 2) (111111110010)2 = 1111 1111 0010 = (F F 2)16 Where…
Q: Question 11 Create pseudocode OR Python code that uses a "for" loop or a "for each " loop to display…
A:
Q: Write a program to add 2 numbers (16 bits each). The first one is stored in ML starting at 2030, the…
A: MEMORY ADDRESS MNEMONICS COMMENTS 2000 LHLD 2030 A ← 2030 2003 XCHG D ← H & E ← L 2004…
Q: What is meant by short-circuit evaluation? Find (or come up with) an example of where this would be…
A: The process of which the compiler skips the execution of few expressions in a logical expression is…
Q: Simply to minimum number of literals using Boolean Algebra. Answer both parts and show all steps.…
A: Boolean Algebra is a branch of mathematics that works on logical values. They are used in various…
Q: bootstrap classes to ke a Credit Card Card Owner Card Owner Name Card number Valid card number…
A:
Q: Q3: Convert the following to their equivalent :- 1- (B8E)16 ( ? )10 2- (15.73 ) = ( ? )/2 3-…
A: 1. Step 1:- Convert B8E16 into decimal:- = B8E16= B × 162+8 × 161+E × 160 = 295810
Q: (a) Let L = {w E {0, 1)*: w does not end in 01} (a) Show a regular expression that generates L. (b)…
A: (a) Answer: ∈∪1∪(0∪1)*(0∪11)
Q: with 500 addresses, two organizations each with. each with 50 addresses, and three organizations…
A: The answer is
Q: Develop a use case diagram.
A: Bartleby allows us to answer only first question when multiples questions are present. So I answered…
Q: e pseudocode OR Python
A: Python code: size = 10values = [1, 2, 3, 4, 5,6,7,8,9,10];print("Elements of given array: ");for i…
Q: BinaryTreeExpression { ExpressionNode root = new ExpressionNode("XXX"); // it will simply hold the…
A: // package s2; // expression node class ExpressionNode { String node; ExpressionNode left, right;…
Q: When a child process utilizes unnamed pipes to read the parent's message buffer, what h
A: The answer is
Q: Explain why change is inevitable in complex systems and give examples (apart from prototyping and…
A:
Q: Program Specifications Write a program to calculate the cost to paint a wall. Amount of required…
A: Step-1: Start Step-2: Declare variables wallHeight, wallWidth and cost and take input from user for…
Q: Q3) Write a program that converts the weather from Celsius to Fahrenheit in a specific day. The…
A: Program Code: #include <iostream> #include <cstring>using namespace std; int main(){…
Q: Be careful to answer the following questions in your own words. 1. What is Information Security? 2.…
A: 1. INFORMATION SECURITY:- Information security is not the only protection against unauthorized…
Q: This activity shall determine the rank and nullity of a matrix. Create a function that will be able…
A: Matlab code:
Q: Proposition (Distributive Law): For expressions p1, P2, P3, any word matching the regular expression…
A: Given that, p1, p2 and p3 are the expressions. Given regular expression is (p1(p2|p3)) and another…
Q: Problem 5-Write a function that get a list of numbers as input and checks to see if it is a set or…
A: The code implementation is given below. Algorithm: Prompt the user to enter the number of elements…
Q: Verify that the BFGS matrix satisfies the secant condition.
A:
Q: Part II: Write a program to calculate the area of a triangle given the length of its three sides-a,…
A: # Length of sides must be positive# and sum of any two sidesdef findarea(a,b,c): # must be smaller…
Q: write python program to print Hello.
A: The print() function prints the predefined message to the screen, or other standard yield gadget.…
Q: 3. . Use the universal set U - {0, 1, 2, 3, 4, 5, 6, 7) and the sets A = (1,5), B = {1,2,3,4) and C…
A: a) A ∩ B = {1,5} ∩ {1,2,3,4} = {1} b) A ∪ B' = B' = {0,1,2,3,4,5,6,7}-{1,2,3,4} = {0,5,6,7} A ∪ B'…
Q: Determine the output of the following Pep/9 machine language program. The left column is the memory…
A: Given, 0000 C10008 0003 06 0004 F1FC16 0007 00…
Q: 4. An ISP is granted the block 80.70.56.0/21. The ISP needs to allocate addresses for two…
A: The question is to find the number and range of addresses in ISP block.
Q: raw a game tree (upto depth level 2) for the given version of the Nim game. Please consider figure 1…
A: The Nim event's restrictions: Nim is a computational game in which two participants receive turns…
Q: NW_Q3) IP addressing operates at the network layer (Layer 3) of OSI, IP addresses must be able to…
A: The answer is
Q: Write a Python program to find the size of a singly linked list.
A: class Node: # Singly linked node def __init__(self, data=None): self.data = data…
Q: 1. a) Given the array of numbers 50 10 90 120 -13 3 89, you are asked to apply BinarySearch to find…
A: What is the best achievable time complexity for an unsorted array? How many items in the array is…
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- 6. using c++, Write a function that counts the number of times an integer t occurs in an array of integers.Python Q1) Write a function get_new_grades, such that given a list of grades as an input parameter,returns a new list where the minimum score isreplaced by 50.Do not modify the initial list! Q2) Write a function compute_stats, such that given a list of grades as an input parameter,it calls the function get_new_grades (defined in the previous questions)and returns a list that contains the average value of the initial list andthe average value of the list from the get_new_grades function.1. Write a recursive function that takes as a parameter a nonnegative integer and generates the following pattern of stars. If the nonnegative integer is 4, then the pattern generated is:********************Also, write a program that prompts the user to enter the number of lines in the pattern and uses the recursive function to generate the pattern. For example, specifying 4 as the number of lines generates the above pattern. 2. A palindrome is a string that reads the same both forward and backward. For example, the string "madam" is a palindrome. Write a program that uses a recursive function to check whether a string is a palindrome. Your program must contain a value-returning recursive function that returns true if the string is a palindrome and false otherwise. Do not use any global variables; use the appropriate parameter.
- C. In permutations and combinations, the term “n C r” refers to n combinationstaken r at a time.??? =?!/?! (? − ?)!Write a recursive function to find the factorial of a number.Use the defined function to compute the term “nCr” for the following scenario:The values of ‘n’ and ‘r’ are stored in two parallel arrays of any user definedsize . You have to Read the arrays n and r at run time. Compute n C r for eachcorresponding terms in the array ‘n’ and ‘r’, and display it properly formatted.Also your program should print the current date and time using libraryfunctions4.10 LAB: All permutations of names Write a program that lists all ways people can line up for a photo (all permutations of a list of strings). The program will read a list of one word names, then use a recursive function to create and output all possible orderings of those names separated by a comma, one ordering per line. When the input is: Julia Lucas Mia then the output is (must match the below ordering): Julia, Lucas, Mia Julia, Mia, Lucas Lucas, Julia, Mia Lucas, Mia, Julia Mia, Julia, Lucas Mia, Lucas, Julia def print_all_permutations(permList, nameList): # TODO: Implement method to create and output all permutations of the list of names. if __name__ == "__main__": nameList = input().split(' ') permList = [] print_all_permutations(permList, nameList)1. Write a function that converts a phrase into pig Latin. A word is convertedto pig Latin by removing the first character of the word, placing it at theback of the word, and adding the characters “ay” to the word. For example,“hello world” in pig Latin is “ellohay orldway.” Your function can assumethat each word consists of at least two letters and that each word is separatedby one space, with no punctuation marks.2. Write a function that counts the occurrences of a word in a string. Thefunction should return an integer. Do not assume that just one space separates words and a string can contain punctuation. Write the function sothat it works with either a String argument or a StringBuilder object.3. Write a function that takes a number, such as 52, and returns the numberas a word, as in fifty-two.4. Write a subroutine that takes a simple sentence in noun-verb-object formand parses the sentence into its different parts. For example, the sentence“Mary walked the dog” is parsed into…
- Design a function that accepts an integer argument and returns the sum of all the integers from 1up to the number passed as an argument. For example, if 50 is passed as an argument, thefunction will return the sum of 1, 2, 3, 4, . . . 50. Use recursion to calculate the sum.def fun_a(cards): """ cards is a list of int numbers ranging between 0 to 12 inclusive. We use the number to represent the card's rank in a deck of card. 0 is '2', 1 is '3', ...,9 is 'J', 10 is 'Q', 11 is 'K' and 12 is 'A' This function is to check if there is four of a kind in the cards (4 cards of the same rank) and a fifth card as a kicker to form a four of a kind hands with 5 cards total. The 5 cards look like this: x x x x y (x might be the same as y). If there is more than one way to form such a hand with given cards, choose x that has the highest ranking (that has 4 cards of rank x), and choose y that has the highest ranking in the remaining cards after removing 4 x's. return (x, y) if such a hand exists. otherwise return None. """Please fill in the blanks for C, from 1 to 68. /*The program will get the information of each client and print it right back. We could get the information of all clients first, then print them all later for better readability using an array of struct.*/ #include<stdio.h> #include<stdbool.h> #define length 70 //assume there's no names longer than 70 /*It's good practice to add all function headers to the top of the program*/ __1__ __2__ getEmployeeInfo(); __3__ printEmployeeInfo(__4__ __5__ em); __6__ __7__ getClientInfo(__8__ i); __9__ printClientInfo(__10__ __11__ cli, __12__ i); /*Employee struct: all the arrays use the same constant size defined on top name-first, last-(string) title (string) number of clients (integer) number of years working at the company(can take decimal points). */ __13__ employee { __14__ first_name[__15__]; __16__ last_name[__17__]; __18__ title[__19__]; __20__ num_clients; __21__…
- “Days Into Year (C++)” By using my code (photo is attached), implement a Days Into Year function. It MUST BE of this form: int daysIntoYear ( int year, int month, int day ) ; In terms of "Days Into Year," how many days are we into the year based on a given date? For example, January 1 is 1 day into the year. Please have the code display 12 test cases with the result from the function, and the number of days into the year from some other source. So you can hand calculate the days into the year or use an internet web page. The typical output might look like this: (Please make the format better but be sure to automatically calculate agree/disagree column) You must include a leap year function that returns a bool and takes as a parameter the year. This function must be used in your code. Year Month day Days Into Year Value expected Agree/Disagree 2020 1 1 1 1 agree 2020 1…a- Write a Python function Salary_levels, that takes a list as an argument and returns the number of the high salaries (salary>=5000), the average salaries(1000<=salary<5000, and the low salaries (salary<1000). You can use the following list : salaries= [500,1070,1450,6500,9000,940,450,400,600,2750,1100,8400,1500,900,1200] b- Use the above function to print the counts of the high, average, and low salaries. N.B: the codes of parts a and b should be included in your answer.Read Chapter 12 Recursive Lines Write a recursive function that accepts an integer argument, n. The function should display n lines of asterisks on the screen, with the first line showing 1 asterisk, the second line showing 2 asterisks, up to the middle line which shows n asterisks. You will then continue to print less stars until your last line of one asterisk. With an input of 3 your output should look like below. You will need to wind the stack to print up to your largest line. You will print the last set of lines as you unwind the stack or as you come out of your recursion. * ** *** ** *