1,474 Answered Questions for the topic computer programming
Computer Programming Python
06/22/23
(Geometry: point in a rectangle?)
Write a program that prompts the user to enter a point (x, y) and checks whether the point is within the rectangle centered at (0, 0) with width 10 and height 5. For example, (2, 2) is inside the...
more
Computer Programming Python
06/22/23
(Science: day of the week)
Zeller’s congruence is an algorithm developed by Christian Zeller to calculate the day of the week. The formula ish=(q +26(m+1)//10+k+k//4+j//4+5j)%7where- h is the day of the week (0: Saturday, 1:...
more
Computer Programming Python
06/22/23
(Find the number of days in a month)
Write a program that prompts the user to enter the month and year and displays the number of days in the month. For example, if the user entered month 2 and year 2000, the program should display...
more
Computer Programming
06/21/23
Given two variables, is_empty of type bool, indicating whether a class roster is empty or not, and number_of_credits of type int, containing the number of credits for a class,
write an expression that evaluates to True if the class roster is not empty and the class is one or three credits.
06/11/23
IEEE-754 standard for 32-bit floating point
Using the IEEE-754 standard for 32-bit floating point, what biased exponents and mantissa values as given below represent NaN? (Choose all that apply) 0 and nonzero 0 and 255 0 and 0 255...
more
06/11/23
What is the biased exponent in this example, expressed as decimal?
Question 10To find the IEEE-754 SP floating point representation of the binary number 0.0000111, one first shifts thedecimal point to the (left or right) by right, 5 places. Question 11(Continuing...
more
06/11/23
Write the decimal number 29.23 as an unsigned fixed point binary
Write the decimal number 29.23 as an unsigned fixed point binary representation with 5 bits for the integer part and 4 bits for the fractional part. Be sure to round up, if needed, to obtain the...
more
Recursion in C - Explain Given Solution
Question: Write a recursive function to add to each number in a linked list the original values of its two neighbors. For example, 10->2->3->5->NULL becomes...
more
Computer Programming Computer Science
06/02/23
What’s the best way to start learning to code?
What Combinations Apply RISC-V
A nested function calls another function (plot_function with parameter a0) and is also called by another function. Given the code that follows RISCV calling convention, which sets of registers...
more
RISC-V Conventions
You are the author of the function F while your friend is the author of the function G. Both F and G are located in the same RISC-V main memory but you and your friend do not know the contents of...
more
Order of RISC-V Conventions
Suppose we have the following stack, where the red line is the indicator for sp: Suppose we now want the stack to contain these additional data items in the following order:We are given the...
more
05/31/23
Online Resources for ML/NNs
I am a novice programmer with a bit of conceptual background in ML/NNs, but I haven't programmed much in Python. Besides tutorials like Kaggle or platforms like Coursera/Edx, what are some free...
more
Assembly and RISC-V Calling Convention
A nested function calls another function (plot_function with parameter a0) and is also called by another function. Given the code that follows RISCV calling convention, which sets of registers...
more
Order of Stack using RISC-V
Suppose we have the following stack, where the red line is the indicator for sp: Suppose we now want the stack to contain these additional data items in the following order:We are given the...
more
05/30/23
Let x = 131 in base 10. If x is represented as an 8-bit unsigned binary integer, and you apply the operation x << 4, what will the result be in base 10?
Let x = 131 in base 10. If x is represented as an 8-bit unsigned binary integer, and you apply the operation x << 4, what will the result be in base 10?
05/29/23
MATLAB Plot of Solutions and Directional Field
I'm trying to plot solutions along with the directional field as in the image given below, of the constant harvesting model given bydP/dt = r*P(1 - (P/M)) - h , P(0) =p0 , where r = 0.8, M = 8000...
more
Computer Programming Python
05/14/23
How do I excel at Python if I have no programming experience?
I'm just started intro to Python. Most of my classmates have programming experience. I feel like an idiot. Should I drop out or continue?
05/09/23
I defined a class ListNode, with few extra definitions added: ListNode_str.h
Re-write this code as a template class, and re-name this file to ListNode.h
#pragma once
#include<iostream>
#include<string>
using std::string;
class ListNode
{
string value; //...
more
05/09/23
Grab the file arraysWork.cpp.
It will not compile as it has some errors in it. Feel free to remove them when you are working on the code. Your goal is to comment on every single line in the function main except for the return...
more
05/05/23
Python Programming - Reading & Resizing Videos in Google Colab Using OpenCV
I used the below code to read and display a video file in Google Colab. However, I do not understand how to resize it to a specific size. Any help would be highly...
more
04/18/23
Elements in a range (python)
I am stuck on a python homework question and I was wondering if I could get some help. The question goes like this:"Write a program that first gets a list of integers from input. That list is...
more
Computer Programming Computer Science
04/14/23
Which of the following is a correct EBNF description of a Java class definition header statement?
Which of the following is a correct EBNF description of a Java class definition header statement?Hint: Java permits only single inheritance, but compensates by allowing multiple interfaces. Group...
more
Computer Programming Computer Science
04/14/23
Write a grammar for the language consisting of strings that always alternate letters a and b.
Write a grammar for the language consisting of strings that always alternate letters a and b.For example, the strings abab, abababab, and abababababab are in the language but a, aaabb, ba,...
more
Computer Programming Computer Science
04/14/23
Match the definition with the proper term.
Match the definition with the proper term: derivation leftmost derivation sentence sentential form rightmost string of symbols in a derivation ->a sentential...
more
Still looking for help? Get the right answer, fast.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.