Write a function to convert a decimal number to a binary number.
Q: Find out how cloud computing stacks up against mobile devices, and why. There are several ways in…
A: Mobile computing lets us access data and information on mobile devices, whereas cloud computing…
Q: Consider the following possible function prototypes for converting a color image to grayscale…
A: Correct Answer : Void bw_filter(struct image *img);
Q: What distinguishes the Internet from the WWW and what similarities do they share?
A: When compared to one another, this question demonstrates how the World Wide Web differs from the…
Q: weights presented on the graph to your Kean ID digits. For example, if the first digit of your Kean…
A: a. draw graph using kleene id and find out minimum weight b. draw using prims algorithm and find out…
Q: Draw the process of top-down parsing for id + id * id with E → TE’ E’ → +TE’ / ∈ T → FT’ T’ →…
A: Here is a diagram showing the process of top-down parsing for the expression "id + id * id" using…
Q: add the following binary numbers: 1.) 10101101101111 2.) 11010011 +11001000 3.) 1010101110011010 4.)…
A: Addition of binary numbers 1) 10101101 + 10111110 2) 11010011 + 11001000 3) 10101011 + 10011010 4)…
Q: I'm writing a text adventure java game and I'm having trouble calling my enemy class this is what I…
A: Java: Java is a high level, general purpose programming language. It is secured language. It…
Q: 1- A microservice is a web service that only responds to specific requests and cannot consume any…
A: Introduction SOAP: Data may be sent between apps created using various programming languages using…
Q: MATLAB PLEASE Write a general binary search code that can find a target with multiple appear- ances…
A: MATLAB which it is a proprietary multi-paradigm programming language and numeric computing…
Q: ch of the following is not a goal of Software Engineering: Make Complex Software/Systems Manageable.…
A: Dear Student, The answer to your question is given below -
Q: To what extent do conventional telephone networks differ from the Internet?
A: 1. While on the internet, it is a worldwide network that everyone can use, and it is also known as…
Q: Draw how an item can be added to the end of a doubly linked list. (show the steps in multiple…
A: INTRODUCTION: The data and additional pointer, known as the prior pointer, that are present in the…
Q: Using the do-while loop, Draw a simple calculator flowchart of your choice using a minimum of 5…
A: input x, yinput operatortimes = 1;do{ if (operator == "+"") output x + y; else if(operator ==…
Q: Match the structures below with the kinds of languages that they are able to recognize. Not all…
A: In the Theory of computation, lots of languages are available there are various types, and it is…
Q: 3.30 LAB: A Jiffy Jiffy is the scientific name for 1/100th of a second. Define a function named…
A: algorithm:- read number of jiffies define jiffies_to_seconds(pass jiffies from outside):return…
Q: Question 15 A program consists of 100,000 instructions as follows: Instruction Type Integer…
A: Answer the above question are as follows
Q: Document databases store documents using Key/Value pair in _____ format with many levels of nesting.…
A: Introduction Document Database: A non-relational database called a document database is made to…
Q: Which of the following regular expressions recognizes the language of all strings from {a,b} * such…
A: In this question we have to identify the regular expression expressing the language where a should…
Q: Difference between Numeric notation and symbolic notation.
A: Introduction Notation: A set of written symbols used to represent something, such as music or…
Q: The volume of any cylinder can be calculated using the following formula: volume = π * radius² *…
A: algorithm:- read value of r and h. if r>0 && h>0 v=3.1416*r*r*h display v…
Q: : DisplayCharAray * arguments: array of char * returns : nothing * display : all the
A: Dear Student, The source code, implementation and expected output of your program is given below -
Q: A program consists of 100,000 instructions as follows: Instruction Type Integer arithmetic Data…
A: We don't need to calculate the CPI for this given problem. Speed Up of machine M with two CPU can…
Q: Outline the pros and cons of using these three prevalent types of networks.
A: A computer network connects and shares resources, data, and applications, such as operating system…
Q: To what end is proficiency in spreadsheets now expected of all workers? Please provide two examples…
A: Spreadsheets are the second-most-used business software behind email, and with good reason. Excel,…
Q: I need help fixing this python code since it's displaying an error message display below. : def…
A: Introduction: Step 1. Start Step 2. Make a new list called my list. Step 3. Request that the user…
Q: The following are the elements that influence the Big-O performance of a hash table, in order of…
A: The following are the main elements that affect how well a hash table performs in the Big-O problem…
Q: ohabbat down
A: HTML: The HTML form design: Group the related element of the form by drawing a box around them…
Q: Given the 1000wing Person News feed source OA. One person can track several news feed sources or…
A: For this given diagram option (A) One person can track several news feed sources or none; one news…
Q: Question 23 Some portion of cache system A represented below. The system is byte-addressable and the…
A: Given that the number of TAG bits = 14 Number of LINE bits = 8 Number of word bits = 2 Hence The…
Q: Characters Decimal Binary C O d i n
A: Here in this question we have given some English character and we have asked to convert them in…
Q: The Megawatt Solar Panel Company installs solar panels on home rooftops. The base installation…
A: SOLUTION- I have solved this problem in VISUAL BASIC code with comments and screenshot for easy…
Q: . Define a Turing Machine that accepts the following language: L = {w ∈ {!, }∗| w = vw'v where v, w'…
A: INTRODUCTION: A mathematical model of computing known as the Turing machine describes an imaginary…
Q: Use D flip-flops to design a counter with the following repeated binary sequence: 0, 4, 2, 6, 10, 8,…
A: Please refer to the following step for the complete solution to the problem above.
Q: Rewrite Programming Exercise 7.4 using streams. package Exercise_30_3; import java.util.Scanner;…
A: Import the Scanner and Arrays classes from the java.util package. Define a main() method that takes…
Q: Question 3 Suppose you have hardware that you are trying to improve by adding additional…
A: Here is the mathamatical formulation of the solution regarding finding the number of processors:
Q: In Python with comments please 4. Largest List Item Design a function that accepts a list as an…
A: Introduction: When calling a function in Python, we may quickly expand a list, tuple, or dictionary…
Q: Let's assume that we are going to read an integer and store it into the variable N. Fill in the…
A: The answer is given below.
Q: hat are the components of two-factor authentication? Provide examples to support your answer.
A: Introduction: Multi-factor authentication, sometimes referred to as two-factor authentication or…
Q: Question 10 1. Assume we are using 2 keys: K1 and K2, which of the following schemes is stronger…
A: 1. Assume we are using 2 keys: K1 and K2, which of the following schemes is stronger and why?…
Q: If possible, please provide TWO solutions to the problem of data security.
A: DATA HAZARDS: Data hazards arise when data-dependent instructions have an impact on data at various…
Q: SQL and Relational Algebra Related question There is a Company Database that manages the data of…
A: We need to write the query of the above problem.
Q: 1. Categorial proposition is known a. To express a condition b. To express the nature of…
A: Disclaimer: “Since you have asked multiple questions, we will solve the first question for you. If…
Q: Translate the statement answer = ((one – onecase) * (two – twocase)) * (three – threecase) into…
A: We need to translate the statement answer = ((one – onecase) * (two – twocase)) * (three –…
Q: A 2. Among all 8 CBK domains, in which CBK domain do you believe you own the strongest knowledge and…
A: let us see the answer:- Introduction:- The Common Body of Knowledge (CBK) in security is a thorough…
Q: .file .text .global f f: clr r14 "f.s" jmp.Ltest .Ltop: mov r15, r13
A: Dear Student, The answer to your question is given below -
Q: Make the background of a webpage darkgrey. Make the large headings of a webpage centered on the…
A: The requested CSS code is given below with explanatory comments.
Q: There are a total of three user processes running in an OS, and each of them uses up two instances…
A: Introduction: In an operating system, there are three user processes, and each of them uses two…
Q: tion has the following format: Machine Instruction: 8 Bits OpCode: 3 Bits Oper
A: Dear Student, The answer to your question is given below -
Q: A quality engineer establishes and maintains a company's quality standards and tests systems to…
A: Quality engineer is basically responsible for quality of product. Whether that product is working in…
Q: java Compute a table representing the Knuth-Morris-Pratt failure function for the pattern string…
A: Your Java program is given below as you required with an output.
C++
is my answers correct ?
- Write a function to convert a decimal number to a binary number.
Answer:
#include <iostream>
#include <string>
using namespace std;
string decToBin(int dec) {
string bin = "";
while (dec > 0) {
bin = to_string(dec % 2) + bin;
dec /= 2;
}
return bin;
}
int main() {
cout << decToBin(10) << endl;
return 0;
}
- Write a function to calculate s =1!+2!+3!+....+10!
Answer:
#include <iostream>
using namespace std;
int findFactSum(int n)
{
int f = 1, Sum = 0;
for (int i = 1; i <= n; i++) {
f = f * i;
Sum += f;
}
return Sum;
}
int main()
{
int n = 10;
cout << findFactSum(n);
return 0;
}
Step by step
Solved in 3 steps with 4 images
- Write a function that counts and returns the number of vowels in the string. (For the purposes of this exercise, we are talking about the standard 5 vowels -- A, E, I, O, U). Write a function that counts and returns the number of consonants in the string. Write a function that converts the string to all lowercase. Write a function that converts the string to all uppercase. Write the following functions. Each of these functions should have a single parameter -- accepting a c-style string as an argument. The function should only do what is specified (note that none of these functions do any output to the screen). Your functions should use const in the prototype wherever it is appropriate: Write the main function that offers a menu and allows the user to test the functions you have implemented. Program C++, must use c- styleQ3: Write a complete C++ program that contains the integer functions (main, funx and funy). The main function declares an integer (k), which is assigned a value using cin. Then print funx(k), where funx(n)=2*funy(n-1) if n >1 and funx(n)=1 if n1 and funy(n)=1 if nYou must answer the Problem in C++. (Anagrams) Write a function that checks whether two words are anagrams. Two words are anagrams if they contain the same letters in any order. For example, “silent” and “listen” are anagrams. The header of the function is as follows: bool isAnagram(const string& s1, const string& s2) Write a test program that prompts the user to enter two strings and checks whether they are anagrams. Sample Run 1 Enter a string s1: silent Enter a string s2: listen silent and listen are anagrams Sample Run 2 Enter a string s1: split Enter a string s2: lisp split and lisp are not anagrams
- In C++ Implement a function shout that prints a line consisting of a string followed by three exclamation marks. For example, shout("Hello") should print Hello!!!. The function should not return a value. In the main function, call your function twice, once for each input string. Complete the following file: shout.cpp: #include <iostream> using namespace std; int main(){ string input1; cin >> input1; string input2; cin >> input2; . . . return 0;}Write a C function strSumNums() that takes a string as parameter, computes and returns the sum of numbers in the string.This function can call a function that returns the address of first digit character in a string.Example: "CS101 and CS363 are 2 CS courses." → 466 (= 101 + 363 + 2)Prototype:int strSumNums(char str[]);in c, Writing a program to make the user able to enter text and then enter a letter he wants to remove from this text. I need to write a C function that deletes the desired character in a given character string. Don't use the library function for string operations. * following this finction void letterDeleted(char str[], chardeleted_letter) { }
- In c++, please. Thank you! A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. Write a program that first takes as input an integer N that represents the number of word pairs in the list to follow. Word pairs consist of a name and a phone number (both strings). That list is followed by a name, and your program should output the phone number associated with that name. Define and call the following function. The return value of FindContact is the index of the contact with the provided contact name. If the name is not found, the function should return -1 This function should use binary search. Modify the algorithm to output the count of how many comparisons using == with the contactName were performed during the search, before it returns the index (or -1). int FindContact(ContactInfo contacts[], int size, string contactName) Ex: If the input is: 3 Frank 867-5309 Joe 123-5432 Linda…Give solution in C ++ Language with secreenshoot of source code. Part 1 Write a function that inputs two integers in main() function and passes the integers to a function by reference. The function swaps the value. The main() function should display the values before and after swapping.Temp= Variable A;Variable A= Variable B; Variable B= TempPart 2Write a function that takes an integer n as parameter and returns the sum of its digits. For example, the program should display 9 if the user enters 135.Write a function in C# that takes in a string as input and returns a new string with all of the vowels removed. The function should be case-insensitive, so both uppercase and lowercase vowels should be removed. The input string will only contain alphabetical characters and spaces. Example: Input: "Hello World!" Output: "Hll Wrd!" Constraints: The input string will have at most length 100. Can you write a C# function that solves this problem? public string RemoveVowels(string s) { // Your code here }
- Solve the problem in C++ (Binary to decimal) Write a function that returns a decimal number from a binary string. The function header is as follows: int bin2Dec(const string& binaryString) For example, binaryString 10001 is 17 (1*2^4+0*2^3+0*2^2+0*2+1=17 ). So, bin2Dec("10001") returns 17. Write a test program that prompts the user to enter a binary number as a string and displays its decimal equivalent value.Write a C function countDigits() that takes a string as parameter, finds and returns the number of numeric characters ('0', '1', ... '9') in the string. Prototype: int countDigits(char str[]);Write a C++ function (along with the helper functions) that deletes all occurrences of a word from a given string. The code should follow the exact function declaration given: void deleteWords(char*inputString, char*word, char*destString);