2.16 LAB: Musical note frequencies On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of fO * r^, where n is the distance (number of keys) from that key, and r is 20/12) Given an initial key frequency, output that frequency and the next 4 higher key frequencies.
Q: 1- Write a java program that stores, retrieves, adds, updates and search addresses as shown in…
A: To create Person class and Person operation class with add, update, search, first, next, last…
Q: 4.main(){ int i,j; long int f=1; for (i=1, i< 10; i++) f=f*i; } prinf(“%ld",f);}
A: Factorial Program in C: Factorial of n is the product of all positive descending integers. Factorial…
Q: Q2. Write a program to calculate the value of y, where x, is series of value in data set (x[i]), n…
A: Note :- You have not mention the language of program ,So i am doing you question in C++ language.…
Q: 5.23 LAB: Adjust values in a list by normalizing When analyzing data sets, such as data for human…
A: Answer :-
Q: 8. You live in a village. The village can be represented as a line that contains n grids. Each grid…
A: C code with output provided below:
Q: Musical Key Conversion The chromatic scale is a 12-note scale in music in which all notes are evenly…
A: #converted code def covert(notes,size): scale = ['A', 'A#', 'B', 'C', 'C#', 'D', 'D#', 'E', 'F',…
Q: An acronym is a word formed from the initial letters of words in a set phrase. Write a program whose…
A: Logic: Accept input string from the user. Check the first character if it is upper case character…
Q: 10 - In an examination, 500 students appeared. Out of these students, 38 % got A+ grade, 45 % got B+…
A: Program to find the number of students who got A+, B+ and the number of students who just passed.
Q: 7. a) Write down the 5 by 5 adjacency matrix for the undirected graph below (Figure 1). A C E B…
A: The following is the adjacency matrix for the given graph: A B C D E A 0 1 1 0 0 B 1 0 1 1…
Q: 3. Write a code for craps game. Craps is a dice game in which the players make wagers on the outcome…
A: As per our guidelines we are supposed to answer only one question. Kindly repost the remaining…
Q: c
A: Error: The variable i is not declared. Nature: The variable i is used in for loop but never been…
Q: Consider the below code snippet. Assume bool foundPair and int pairCount are both declared and have…
A: Answer : True.
Q: Write a program that takes a date as input and outputs the date's season. The input is a string to…
A: To write python code for display the seasons accordingly.
Q: int s(int *a, int *b) *a=*a+*b; *b=*a-*b;
A: Lets see the solution in the next steps
Q: Write a program with total change amount as an integer input that outputs the change using the…
A: [Note: please use proper indentation to avoid erros. snapshots of program code are provided in step…
Q: U={A,B,C,D,E,F}, A={A,B,D,E}, B={B,C,E,F}, and C={A,B,C,D} complete the following set operations:…
A: lets understand set operations: Intersection : A n B : common elements of both sets A and B for…
Q: 8. You live in a village. The village can be represented as a line that contains n grids. Each grid…
A: Each person can reach 1 grid. People can only access their homes. Note that HB.BH also works. Each…
Q: int a=6; int s-%3; while(a>10) S=s+a; cout<<"a="<<a<<endl; a+=23; cout<<"a="<<a; A) a=8 b=6 B. a=6…
A: Given : int a=6; int s=0; while(a>10) { s=s+a; cout<<"a="…
Q: 28. Write a few lines of code to declare a bag of strings and place the strings squash and handball…
A: #include <iostream>#include <vector>#include <string>using std::string; int…
Q: 3. Show the Huffman Code for each character in the following string. “boss demigoddess ship”
A: We are given a string and we are asked the Huffman code for each character. First, we will check…
Q: 21.4 LAB: Parsing dates Write a program to read dates from input, one date per line. Each date's…
A: Step 1 The code is given in the below step
Q: Question 5: Write a program that inputs four strings that represent floating-point values, converts…
A: NOTE: SINCE THE LANGUAGE OF THE CODE IS NOT MENTIONED, I HAVE USED C FOR THE SOLUTION Define header…
Q: 7. Create a function called word_difference that prompts the user for two English words, and…
A: Input two string convert it into set subtract both the set and print that result
Q: 4/27/2021 assignment: Write a program to perform addition, subtraction, multiplication, and…
A: Below is the required Java code: -
Q: 8. The dynamics of a comet is governed by the gravitational force between the comet and the Sun, f=…
A:
Q: x=2.9 a=floor(x) b=ceil(x) c=round(x) d=int(x) print(a,',',c,',',b,',',d) 2,3,3,3 2,3,2,3 2,3,3,2…
A: The correct option will be Option(3) 2,3,3,2 Explanation:- In the given program float value are…
Q: 13. Consider a freight company. This company may deliver packages around the world. Each package has…
A: 13. Algorithm: Start Read tracking code and store it in code Craete an object of regex b by passing…
Q: 1- Write a java program that stores, retrieves, adds, updates and search addresses as shown in…
A: Actually, java is a object oriented programming language.
Q: 01 - Multiplication Times Table Print a multiplication times table from 0 to a user entered number…
A: Answer in step2
Q: 9. Write a program that prints the numbers 1 to 4 on the same line with each pair of adjacent…
A: C++ program for the given problem:-
Q: (2) Let P (x, y) : x plays in y." A(x): x is athletic." S(x) :x is smart." E(y) : y is in English…
A: Given: Let P (x, y): x plays in y. A(x): x is athletic." S(x) : x is smart." E(y): y is in…
Q: 6.6 In Python, Many documents use a specific format for a person's name. Write a program whose…
A: Note: Make use of the indentation properly as shown below in the program to compile the program…
Q: algA2 (int[] A){ int i = 1; while (i < A.length){ for (int j = 0; j < A.length; j++){ A[0] = A[0] *…
A: Consider the given Code:
Q: Write a program that takes a date as input and outputs the date's season. The input is a string to…
A: CODE:- input_month = input()input_day = int(input())month= ('January', 'February','March', 'April'…
Q: x=2.9 a=floor(x) b=ceil(x) c=round(x) d=int(x) print(a,',',c,',',b,',",d)
A:
Q: (6) Implement the ReplaceExclamation() function. ReplaceExclamation() has a string parameter and…
A: Functions declared: Compare() to compare the string if ! (exclamation) is prefix of the string and…
Q: An acronym is a word formed from the initial letters of words in a set phrase. Write a program whose…
A: p[o] means first latter of every word split method convert sentence in to word like this so now we…
Q: 1- Write a java program that stores, retrieves, adds, updates and search addresses as shown in…
A: Given Data To create Person class and Person operation class with add, update, search, first, next,…
Q: 1 int[] a = new int[n]; 2 a[0] = 0; a[1] = 1; 3 int x = 0; 4 for (int i = 2; i < n; i++) { 5 x =…
A: public class Main{ public static void main (String[] args) { int n = 10; int[] a…
Q: 6.5 For each of the following write a. Create a list of the first 10 multiples of 13 (from 13 to…
A: Python program for list comprehension: # List comprehension of first 10 multiples of 13 multiples =…
Q: Consider the following single-quoted string literal: 'baby robot' What is the character at index 1?
A: here in this question we have given a string s='baby robot' and we have to find out what would the…
Q: Write a program that takes a date as input and outputs the date's season. The input is a string to…
A: Note: Since the programming language is not mentioned we are providing the solution in Python…
Q: 11.10 LAB: All permutations of names Write a program that lists all ways people can line up for a…
A: Program Approach: Defining necessary header files Declaring a function AllPermutations Using if…
Q: Three numbers a. Write a program that reads three numbers and prints “all the same” if they are all…
A: Note:- Since programming language is not mentioned we are providing solution in c++ . please repost…
Q: 5.17 LAB: Output words in a sentence that are at least 4 characters long
A: I have provided PYTHON CODE along with CODE SCREENSHOT and also provided OUTPUT…
Q: 7. Write a function that evaluates the area of a pentagon. Use "math.pi", for pi, and "math.sqrt"…
A: Area of pentagon Pentagons can be convex or concave, regular or irregular. One with equal sides and…
Q: Create union floating point with members float f, double d and long double x. Write a program that…
A: Below is the required C program: - Approach: - Include the header files. Create the union…
Q: 3.13 LAB: Exact change Write a program with total change amount as an integer input, and output the…
A: coded in python to get the above output of exact changes (Python Language)
Q: P#3. Even fellows (amigos "pares"). Using different starting values, a sequence can be expressed as…
A: The sequence is started from a starting value. The next term in the sequence is half of the previous…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- a) Write a program that asks user to enter number of vertices in an undirected graph and then the adjacency matrix representing the undirected graph. The program, then, must display whether the given graph is connected or not. You will find two sample runs of the program below. Sample 1 Sample 2 Enter number of vertices: 3 Enter number of vertices: 3 Enter adjacency matrix: 0 1 1 1 0 0 1 0 0 Enter adjacency matrix: 0 1 0 1 0 0 0 0 0 The graph is connected. The graph is not connected.Ex1: If A=the odd numbers between (1,20), B= the even numbers between (2,20) find (1)A+B, (2)A.B, (3) A', B' ,(4)A'.B' ,(5)A*B, (6)A*B' (7) A'/B' ,(8)A'./B' ,(9)A/B (10)A./BPart 4: Hexadecimal Representation (Base 16) Another commonly used number system in computer science is hexadecimal, which is base 16. That means each digit has 16 possible values and the position of each digit going from right to left represents increasing powers of 16. In order to represent 16 possible values in a single digit, we use letters to represent the numbers greater than 9: A B C D E F 10 11 12 13 14 15 The process for converting a hexadecimal number to decimal is the same as for binary, just using powers of 16. Here is an example converting the number 1B7 to decimal: 1 B 7 256's place 16's place 1's place 16^2 16^1 16^0 (16^2 * 1) + (16^1 * 11) + (16^0 * 7) = (the letter B represents 11 as shown in the table above) (256 * 1) + (16 * 11) + (1 * 7) = 256 + 176 + 7 = 439 So the number 439 in hexadecimal is 1B7. You can also convert decimal to hexadecimal using the same division method as binary, except by dividing by 16. Remember to convert the…
- Q3 / Write a program in C # that lets the user to define the number of rows and columns. Then, the program reads the matrix and finds the index of the even and odd numbers and display them with their corresponding indices. Use adequate messages during the program execution.int a[10] = {0,1,2,3,4,5,6,7,8,9};int *m = &a[0];int *p = &a[5];int *q = &a[1]; p = (int) m + (int) p - (int) q; what is the value of of *pWrite in C language Description Gomoku, also called Five in a Row, is an abstract strategy board game. It is traditionally played with black and white stones on a 19×19 board.The winner is the first player to form an unbroken chain of five stones horizontally, vertically, or diagonally. Please write a program to determine if there is a winner or not. Input Input content 19 line, each line content 19 character and a new line O represent white stone, X represent black stone and _ means there is no stone on that spot. Output Output "White" if white win, "Black" if black win, "No winner" if no one win.
- Q1\A) A paint company is trying to recycle unpopular paint colours by mixing them together to create better colours. All paints are composed of four pigments (A,B,C,D). The current paints are composed of pigments (in percent) according to the following equations: are p₁ = 80A + 16C + 4D, P2 = 80B + 20C, P3 = 30A + 10B + 60℃, p4 = 10A + 10B + 72C + 8D. The better colour say p5 is composed as follows: p5 = 40A + 27B + 31C + 2D. How much of the paints P1, P2, P3, and p4 should be used to make one gallon of p5. Hint: use (Ax=b). B) Write a MATLAB program to transform temperature from Fahrenheit to Celsius, if the temperature is (OF) and the formula is Celsius= (Fahrenheit-32)x5/9.C Programming Language (Code With C Programming Language) Problem Title : Visible Trees There is a legend about a magical park with N × N trees. The trees are positioned in a square grid with N rows (numbered from 1 to N from north to south) and N columns (numbered from 1 to N from west to east). The height (in metres) of each tree is an integer between 1 and N × N, inclusive. Magically, the height of all trees is unique. Bunga is standing on the northmost point of the park and wants to count the number of visible trees for each Column. Similarly, Lestari is standing on the westmost point of the park and wants to count the number of visible trees for each Row. A tree X is visible if all other trees in front of the tree X are shorter than the tree X. For example, let N = 3 and the height (in metres) of the trees are as follows6 1 87 5 32 9 4 On the first column, Bunga can see two trees, as the tree on the third row is obstructed by the other trees. On the second column, Bunga can see…#Solve it with C programing Mr. X is a student of Computer Science. He is facing a problem and needs your help to solve it.The problem is, you will be given N integer numbers( 4<n<=100) which are arranged side by side (x1,x2,x3,x4,.....).Now you have to sort those items in ascending order. After doing this , your job is to print the items in a sorted way and find the median.[NB: when N is odd , Median= (N+1)/2; When N is even Median= (N/2)+1 ] Sample Input: 74 7 11 2 9 3 5Sample Output:2 3 4 5 7 9 115
- Soundex System Soundex is a system that encodes a word into a letter followed by three digtis that roughly describe how the word sounds. That is, similar sounding words have similar four-character codes. For instance, the words carrot and caret are both coded as C123. A slight variation of the Soundex coding algorithm is as follows: 1. Retain the first letter. 2. For the remaining letters, delete all occurrences of a, e, i, o, u, h, y, and w. 3. Replace the letters that remain with numbers so that (a) b, f, p, and v become 1 (b) c, g, j, k, q, s, x, and z become 2 (c) d and t both become 3 (d) l (that is, el) becomes 4 (e) m and n become 5 (f) r becomes 6 4. If the result contains two adjacent identical digits, eliminate the second of them. 5. Keep only the first four characters of what you have left. If you have fewer than four, then add zeros on the end to make the string have length four. Write a program that carries out the algorithm. See Fig. 6.86.Soundex System Soundex is a system that encodes a word into a letter followed by three digtis that roughly describe how the word sounds. That is, similar sounding words have similar four-character codes. For instance, the words carrot and caret are both coded as C123. A slight variation of the Soundex coding algorithm is as follows: 1. Retain the first letter. 2. For the remaining letters, delete all occurrences of a, e, i, o, u, h, y, and w. 3. Replace the letters that remain with numbers so that (a) b, f, p, and v become 1 (b) c, g, j, k, q, s, x, and z become 2 (c) d and t both become 3 (d) l (that is, el) becomes 4 (e) m and n become 5 (f) r becomes 6 4. If the result contains two adjacent identical digits, eliminate the second of them. 5. Keep only the first four characters of what you have left. If you have fewer than four, then add zeros on the end to make the string have length four. Write a program that carries out the algorithm. See Fig. 6.86. THIS IS DONE IN VISUAL BASICCodeWorkout Gym Course Search exercises... Q Search kola shreya@colum X459: Review- Fibonacci In mathematics, the Fibonacci numbers are the numbers in the following integer sequence, characterized by the fact that every number after the first two is the sum of the two preceding ones: e, 1, 1, 2, 3, 5, 8, 13, Write a recursive function that the returns the nth fibonacci number. Examples: fibonacci(0) -> 0 fibonacci(1) -> 1 fibonacci(7) -> 13 Your Answer: 1 public int fibonacci(int n) { 2 3} 4 CodeWorkout © Virginia Tech About License Privacy Contact