Ex 8) Draw a flowchart for a computer program that will receive numbers andoutput if they are divisible by 3 or not until a zero is entered. When a zero is entered, the program should output how many of the entered numbers were divisible by 3, then stop. IMPORTANT RESTRICTION: you are not allowed to divide the number by 3; therefore, you are not allowed to use the remainder operator (%) over 3 to verify through the remainder if the number is divisible by 3. You may use any other math trick you wish.
Q: Scooby and the Mystery Inc. gang are in a real pickle, or more accurately, you’ll be putting them in…
A: Below is the complete solution with explanation in detail for the given question about Haunted…
Q: PERL programming
A: PERL code:use strict; use warnings; my $var1 = "peter and swimming"; my $var2 = "ann and tennis";…
Q: Hello. Please answer the following Algorithms question correctly. You don't have to give a long…
A: In this question we have to find the distance between the closest two points in a given set, using…
Q: The parser is used to construct sentences out of words in a natural language by a context-free…
A: Navigating the landscape of natural language processing, parsers play a pivotal role in transforming…
Q: In C++ , Write a program for a Bookstore to take an order from a customer, calculate how much to…
A: 1. Display welcome message: "Welcome to the Bookstore!"2. Prompt the user for their first name.3.…
Q: The following decimal numbers are already in six-digit 10's complementary form. Add the numbers.…
A: Answer the above questions are as follows:
Q: Using one line of R code, calculate the interest earned on an investment of $2000, assuming an…
A: You may use the following R code to determine the interest gained on a $2000 investment with a 3%…
Q: python code... xalt = 77.0 y alt= 112
A: Please find below the python code for the given question:Explanation:Step 1:You can use the NumPy…
Q: Describe a database trigger and write 2 advantages of using database triggers.
A: A database trigger is a predefined set of instructions or a piece of code that automatically…
Q: Given the function: F(x,y,z)= y(x'z + xz') + x(yz + yz') a) List the truth table for F. b) Draw the…
A: Boolean expression:Within computers, the word "Boolean" refers to a result that may only take on one…
Q: Given the table PRODUCT(ProductID, ProductName, ProductClass, ProductWeight, ProductStyle,…
A: SELECT Statement:The query begins with the SELECT keyword, indicating that we want to retrieve data…
Q: Write a program that converts a temperature from Fahrenheit to Celsius. It should do the following:…
A: The objective of the question is to write a program in Java that converts a temperature from…
Q: Convert the following decimal numbers to unsigned binary. Show all work and indicate proper units.…
A: Converting decimal numbers to binary is a fundamental operation in digital systems and computer…
Q: In Java, if we say ClassOne "is a" ClassTwo, we mean that ClassOne is a subclass of ClassTwo. True…
A: This question comes from Java Programming Language which is a topic computer science. In this…
Q: Ex 6) assume there is a webpage containing an HTML input of type text and a button. When the button…
A: A flowchart is a graphic depiction of an algorithm or process made up of shapes and arrows. It…
Q: For the format used in Exercise 5.19, what decimal number is represented by each of the following…
A: The format is as follows:Sign bit (1 bit)Exponent (8 bits, excess-128)Mantissa (23 bits, with an…
Q: The Monty Hall problem from last week's video is counter-intuitive. Create a Python lab to run the…
A: The objective of the question is to create a Python lab to simulate the Monty Hall problem multiple…
Q: Assume you have a closed triangulated mesh surface mesh with 4120 triangles. After you perform 1031…
A: 3089 triangles remain in the mesh.Explanation:After performing 1031 edge collapses on a closed…
Q: Create a new project for this program called TestOldMaid and add a class with a main() method. In…
A: Algorithm:Create a class Card representing a playing card with suit and rank.Create a class Deck…
Q: Use the following: basic input and output, expressions, variables, and assignments, the math and…
A: In this question we have to write a Python program to calculate the linear and volumetric changes in…
Q: Code in Java: Create a class called Name that represents a person's name. The class should have…
A: The problem this code addresses is representing a person's name in a structured and organized way…
Q: Explain the role of data structures in programming?
A: A data structure is a specialized format for organizing and storing data in a computer's memory or…
Q: Which of the following are legal array declarations? int [4] names = new int [4]; char[] lets =…
A: The objective of the question is to identify which of the given array declarations are valid in…
Q: Create a class Collection. This class must follow these specifications: Have an integer instance…
A: The objective of the question is to create a class named 'Collection' in Java with specific methods…
Q: Suppose Child is a class derived from Parent. To call a method in Parent from Child, we use: a)…
A: We need to discussed about the classes and we will know here which can be used for after accessing…
Q: question- Implement Floyd's algorithm for the Shortest Path on your system, and study its…
A: Java File Description : The Java file "LastNameFloydsAlgorithm.java" contains a class named…
Q: You are the sysadmin for a big tech company, and you have to estimate the amount of servers you need…
A: In Java:-Step-1: StartStep-2: Define a class Solution Step-2.1: Define function minMeetingRooms,…
Q: 14) Which of the following is an advantage of a doubly linked structure over a singly linked…
A: 1) In a doubly linked structure, each node contains references to both its previous and next nodes.…
Q: What are the basic transaction processing activities performed by all TPS?
A: Transaction Processing Systems (TPS) are critical components of information systems designed to…
Q: in python Integer input_value is read from input. For each number from 0 to input_value both…
A: The objective of the question is to create a Python program that reads an integer from the user and…
Q: Implement a Single linked list to store a set of Integer numbers (no duplicate) • Instance variable…
A: The items that make up a linked list are called nodes, and they are arranged in a linear data…
Q: Why is the native function gets() problematic in the context of C string considerations? A. gets()…
A: The correct answer is D because it highlights one of the main reasons why gets() is problematic in…
Q: Given the relation T below, use ordered pair notation to express the relation To T. ToT { Ex: (a,…
A: This question explores the concept of relation composition in mathematics. Specifically, it asks you…
Q: strcmp compares the strings s1 and s2, returning a value. What are the possible values that it can…
A: A string is a collection of characters used in computer programming and data processing that is…
Q: Solutions to a dynamic programming problem have (at minimum) three things: – A recurrence relation –…
A: LFor the given problem, we need to find the minimal sum path in an n×m grid from the top-left corner…
Q: it is correct but how do i input a newline at the end of it. when i try it makes the output vertical…
A: SOLUTION -In this C code, if we want to create the output vertically instead of horizontally we need…
Q: For the graph below, state the largest integer weight for directed edge (B, C) that makes the given…
A: To ensure that the unique shortest path from A to E is ABCDE, the weight of edge (B, C) needs to be…
Q: Define a function compute_val() that has one parameter and returns 6.9 times the parameter. Ex: If…
A: The objective of the question is to define a function in Python that takes a single parameter and…
Q: Are the languages accepted by the following FAs equivalent? Using the algorithm discussed in Module…
A: As per our company guidelines, only one question will be answered. So, please repost the remaining…
Q: I need help coming up with a truth table that uses three propostions expressed in words and logic. I…
A: The objective of the question is to create a truth table that uses three propositions. The example…
Q: Two Unix users, Emily Jacobs and Tony Weber, need to access current product names and prices. Create…
A: The objective of the question is to create a solution in SQL Server that allows two Unix users,…
Q: RAM: Consider an array ar. How to set in ar[3] the number 4. Please two registers : R1 -for the base…
A: The objective of the question is to understand how to set a value at a specific index in an array…
Q: Solutions to a dynamic programming problem have (at minimum) three things: – A recurrence relation –…
A: In that case; Here's a dynamic programming algorithm for the problem described: Recurrence…
Q: ocode for the algoryt
A: Here is an assembly language Little Man Computer (LMC) software that takes a specified Little Man…
Q: One dimension array in C: Create an array of 100 integer elements and initialize the array elements…
A: Algorithm:Create an array of integer elements and initialize all elements to zero.Populate the…
Q: 10] = {0,1,2,3,4,5,6,7,8,9}; int *m = &a[0]; int *p = &a[5]; int *q =
A: The value (int) m + (int) p - (int) q is allocated to the address p in the provided C code. Let us…
Q: A finite automaton (FA) is an abstract machine that can be used to represent certain forms of…
A: Regular Expression is a pattern used to describe a set of strings that matches the pattern. It…
Q: Ex 4) draw a flowchart to receive a number representing the month (1 for January, 2 for February,…
A: A flowchart is a graphic representation of an algorithm, workflow, or process that shows the steps…
Q: Problem 3. Implement a combinational circuit with 28-bit inputs a and b, and 3 outputs x, y, and z.…
A: Combinational circuits are fundamental components in digital logic design, where the output is…
Q: Given the table PRODUCT(ProductID, ProductName, ProductClass, ProductWeight, ProductStyle,…
A: SELECT Statement:The query begins with the SELECT keyword, indicating that we want to retrieve…
Step by step
Solved in 6 steps with 2 images
- Computer Science This is an introductory exercise to the manipulation of random variables with Python as a language for scientific computing and numerical computation. You have: f(x) = Ae-0.1x)° 4 x*, 0odify the guessing-game program so that the user thinks of a number that the computer must guess. The computer must make no more than the minimum number of guesses, and it must prevent the user from cheating by entering misleading hints. Use I'm out of guesses, and you cheated and Hooray, I've got it in X tries as your final output. (Hint: Use the math.log function to compute the minimum number of guesses needed after the lower and upper bounds are entered.) this is what I got so far: ============================================ import random import math smaller = int(input("Enter the smaller number: ")) larger = int(input("Enter the larger number: ")) maxattempt = math.ceil(math.log(larger - smaller)) count = 0 while count != maxattempt: count += 1 guess = int((smaller + larger) / 2) print(smaller, larger) print("Your number is: ", guess) hlp = input("Enter =, <, or >: ") if hlp == '>': smaller = guess + 1 elif hlp == '<':…2) A BMI Calculator: the body mass index (BMI) is a measure used to determine whether a person is overweight or not. We can calculate BMI from the weight of the person (in pounds) and the height (in inches) of the person. The formula for calculating BMI is: BMI = (weightInPounds 703) divided by (heightInInches squared) In this problem, you will have to create a BMI calculator, i.e., a Java program, that reads the user's weight in pounds and height in inches, then calculates and displays the user's body mass index BMI. Also, display the following information from the US Department of Health) so the user can evaluate his/her BMI: BMI values: Underweight: less than 18.5 Normal: between 18.5 and 24.9 Overweight: between 25 and 29.9 Obese: 30 or greaterA pentagonal number is defined as for 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.: Given a boolean expression consisting of the symbols 0 (false), 1 (true), & (AND), I (OR), and / (XOR), and a desired boolean result value result, create a function that counts the number of ways the expression may be parenthesized such that it evaluates to result. The expression should be completely parenthesized (for example, (0) A(1)) but not excessively (for example, (((0)) / (1))).EXAMPLE \scountEval("l/01011", false) yields 2 counts."0&0&0&1All0", true) = 10Instructions Write the pseudocode and draw the flowchart of the solution for each of the following problems:Scenario As you surely know, due to some astronomical reasons, years may be leap or common. The former are 366 days long, while the latter are 365 days long. Since the introduction of the Gregorian calendar (in 1582), the following rule is used to determine the kind of year: if the year number isn't divisible by four, it's a common year, otherwise, if the year number isn't divisible by 100, it's a leap year. otherwise, if the year number isn't divisible by 400, it's a common year. otherwise, it's a leap year. none of the above year int(input("enter the year")) if (year%4 1-0) and (year%400 -0) or (year % 1000): print (year is common year") else: print(year, is leap year") year= int(input ("enter the year")) if (years !-0) or (year480 1-0) and (year % 1001-0): print(year is common year") else: print(year, "is leap year") D year= int(input("enter the year"))(Learning Objective: students will be able to apply their knowledge of the built-in random package to generate simulations of simple phenomena.) Write a function: • dicesim(D1,D2,trials) that takes as input the number of sides on die 1 (D1) and die2 (D2) and the number of trials. Your function should repeatedly sum pairs of random numbers between 1 and D1 and 1 and D2 and keep track of how many times each sum occurs. The function returns a numpy array with the fraction each sum of rolls occured. Since the numbers are chosen at random, the fractions will differ some from run to run. One run of the function print(p22.dicesim(6,6,10000)) resulted in: [0. 0. 0.0259 0.0615 0.0791 0.1086 0.139 0.1633 0.1385 0.114 0.0833 0.0587 0.0281] or displayed using the code from Section 16.1.1.: PMF of X Note: you should submit a file with only the standard comments at the top and the function. The grading scripts will then import the file for testing.A prime number is a number that is only evenly divisible by itself and 1. For example, the number 5 is prime because it can only be evenly divided by 1 and 5. The number 6, how‐ ever, is not prime because it can be divided evenly by 1, 2, 3, and 6. (Python program)Write a Boolean function named is_prime which takes an integer as an argument and returns true if the argument is a prime number, or false otherwise. Use the function in a program that prompts the user to enter a number then displays a message indicating whether the number is primeBoth while loops and do-while loops are executed as long as a stated boolean condition is true and both while loops and do while loops terminate if the boolean condition is false. What is the only (major, key) difference between the two types of loops. 1. while loops are faster 2. A do-while loop can be rewritten as a for loop, but we cannot rewrite a while loop as a for loop. 3. A do while loop will always execute the loop statements once, but it is possible that a while loop skip all of its loop statements.Exercise III: Catalan numbers For n e N, denote by c, to be the number of ways to form a "mountain range" with n upstrokes (U) and n downstrokes (D) that all stay above a horizontal line. For instance: for n = 1, only UD is allowed, so c = 1; • for n = 2, only UUDD and UDUD are allowed, so c2 = 2. 1. Check that c3 = 5 by writing down or drawing all possible options. 2. Consider the power series +00 g(x) = 2 n=0 (by definition co = 1) called the generating function of the sequence (en). Justify that cn < 4" for each n, and deduce that the radius of convergence of g is at least 1/4. 3. It can be show that for r E (-1/4, 1/4), g(x) = 1+ xg(r)? and therefore 1- VI 4.x g(x) = 2.x Use this formula and the known power series of V1+ x to write the first terms of the power series expansion of g, in the form g(x) = co + c1x + c2x2 + C3x + c4x* + ·.. Show how you obtain a few terms, but you do not need to show all computations and you can use a calculator for fractions. Check that you recover co,…Question: Find the even multiples of any number chosen by the user in a given range – the usershould specify the multiples of which number they want to print and a minimum and maximumvalue. The multiples printed should be within the [minimum, maximum] range. For example, ifthe user chooses the number 7 and would like to print all even multiples in the [15, 60] range, theprogram should print all the even multiples that are bigger than or equal to 15 (minimum), butsmaller than or equal to 60 (maximum). The program should keep a count of how many numberswere printed and should output that count, as well as the numbers. The output then, for theexample given, should be 28, 42, 56, and the count should be 3. Create a flowchart and shell script.SEE MORE QUESTIONS