(Find future dates) Write a program that prompts the user to enter an integer for today's day of the week (Sunday is 0, Monday is 1, .., and Saturday is 6). Also prompt the user to enter the number of days after today for a future day and dis- play the future day of the week. Here is a sample run: Enter today's day: 1 Enter the number of days elapsed since today: 3 Enter Enter Today i s Mondau an the futuno
Q: Should an accumulator be initialized to any specific value? Why or why not?
A: ACCUMULATOR - Accumulator is basically a particular type of a variable , this variable ids used for…
Q: 1. Write a program that performs arithmetic division. The program will use two integers, a and b…
A: Declare variables a, b and c for division Take inputs from user Print the result
Q: 2- Write a program to check a given integer number if it is divisible by 7 or not. 3- Write program…
A: 2, c++ program to fing the program is divisble by 7 : // A Program to check whether a number is…
Q: Write a program that displays every integer between 1 and 100 that is divisible by 5 or 7, but not…
A: Algorithm: 1.Include required header files 2.include main function 3.create a for loop 4.use if…
Q: What is the output of the following loop? System.out.println("+----+"); for (int i = 1; i <= 3;…
A: +----+\ // \\ // \\ // \+----+BUILD SUCCESSFUL (total time: 0…
Q: Rewrite the following statements using combined assignment operators: count = count + 1;
A: The given statement is count = count + 1; In this statement, The addition of the 1 and the…
Q: declare and initialize inputTemp = 0. declare and intialize userChoice = ' '. declare and initialize…
A: The structure is basically a chart derived from the DFD (data flow diagram). It describes the system…
Q: Declaration of this function int myfunction(int x,y){ return(x*y);} ● False O True
A: Answer is given below .
Q: After following statements have executed, find the value of the variable a. int a=5; while (a<=12)…
A: Please find the answer below :
Q: Q2)- Write a program to enter a number from the keyboard, then check: -if the number is bigger than…
A: Given: -
Q: Q: what is the left side of the following expression: x@y1?
A: XOR ⊕ returns 0 for the same input and 1 for different inputs. Given, x ⊕ y ⊕ 1
Q: Write a println statement that produces the following output: / \ // \\ /// \\\
A: \ is the escape character used in printing
Q: X Write a program that converts Fahrenheit to Celsius . The formula for the conversion is as follows…
A: Note: Since you have not provided the language to write the code so I am using C language to write…
Q: Compute the volume of a cylinder) Write a program that reads in the radius and length of a cylinder…
A:
Q: Write true if the two statements are equivalent; otherwise write false. 1. ∼(∼p∨q) and p∨∼q 2. p…
A: Given that 1. ∼(∼p∨q) and p∨∼q 2. p and ∼(∼p) Those two are the statements check whether these are…
Q: In the following expression, select the last operation you would complete. ~p ∨ (q ↔ r)
A: GIVEN: In the following expression, select the last operation you would complete. ~p ∨ (q ↔ r)
Q: Given the code, how many times does the printf statement get invoked? 4 for ( i = 0; i…
A: The first loop is the outer for loop that will run from 0 to 10 excluded 10. The outer for loop will…
Q: After following statements have executed, find the value of the variable a. int a=2 while (a<=25)…
A: Execution:initially a=2iteration:1a<=25 : 2<=25 //condition satisfieda=a*a = 2*2 = 4now, a is…
Q: Write a program to check whether the given number is even or odd.
A: NOTE : As the question is not specific about the programming language to be used to write the code ,…
Q: 9- Write a program which read a number of 3 digits and check if (units, tens, hundreds) digit is…
A: #include <stdio.h>int main(){ int digit[3],i=0,a=5; // Input the digit as an array…
Q: What is the output of the statements below? x=3 while x
A: Given : x=3 while x
Q: write a program that multiply a number in Ax by 19B- write a program that divides the number in BL…
A: Required: A- write a program that multiply a number in Ax by 19B- write a program that divides the…
Q: What does this code print? Print (2**2**3*2)
A: ** represents exponent and has higher precedence than any other operator These exponents are nested…
Q: Write pseudo code that will calculate a running sum. A user will enter numbers that will be added to…
A: # initialize sum = 0 summ = 0 # an infinite loop while True: # taking input num =…
Q: 1. Write a program that reads two integer numbers and determines and prints if the first is a…
A: Check the remainder on dividing the first number with second number and if remainder is 0 then the…
Q: 2)write program that input three number and find the minimum number? 3)write program that input…
A: Main algorithm:- if(a<b && a<c) cout<<a<<" is minimum "; else…
Q: Write the code to check if y is between 80 and 100 (including 80 and not including 100)?
A: Given that, If the input number is between 80 and 100 then print Yes otherwise No.
Q: 3- The below program has errors, trace the below program and mention the errors: # include int main…
A: - We have to correct the code removing the errors.
Q: 2-Write a program which will read in three integers and will output the sum and average of the…
A: Program Plan: Input 3 integers from the user. Calculate the sum and average of the numbers.…
Q: , TRACE the following code and show the PRINTOUT: int x = 1, y =30, z = 10; while (x 0 ) { y = y -…
A: Question Trace output of the below code int x=1,y=30,z=10; while(x<10 && y>0) {…
Q: Write program to print all the numbers divisible by 4 and 5 up to a number of
A: Approach For instance, if N = 20 is set as either a restriction, the program must report any values…
Q: QUESTION 2 Write a program that prints out the following pattern **** **** **** ****
A: Required: C++
Q: After following statements have executed, find the value of the variable a. int a=5; while (a<20)…
A: Code With Explanation: #include <iostream>using namespace std; int main() { int…
Q: start Get positive integer from user, call it A. Get positive integer from user, call it B. C = A B…
A: According to me correct answer will be Option 4. A**A EXPLANATION answer of flow chart will be in…
Q: What is wrong in the following code?try:# Some code here...except…
A: In this code, the use have to mention the else part.
Q: (Demonstrate cancellation errors) A cancellation error occurs when you are manipulating a very large…
A: Given:
Q: int a = 12; int b = 22; System.out.println(!(a >= b) || !(b>=a));
A: Given Question: If the expression's result is TRUE, write TRUE, and if the expression's output is…
Q: Briefly explain the difference between WHERE and HAVING statements. enter respo here
A: The solution to the given problem is below.
Q: 5- Write a program which read a number consists of 4 digits and find the maximum digit of the…
A: Note: Since no programming language is mentioned. I am attempting this in python. if you need it in…
Q: Run the following code and display i and k k = 0; i = 0; while(k<1 && i <1) k = 0; i = i+1; i =…
A: given code: this will result in an infinite loop as i is increasing in a loop but k will always…
Q: 2.Write a program that prompts the user to enter a positive integer and obtains its square root in…
A: The program is written in Java. Please find the source code in the next step.
Q: Which one is correct for the statement? int *ptr, p; *
A: Pointer: It is a variable that stores the address value of another variable. or we can say that it…
Q: Write true if the two statements are equivalent; otherwise write false. (p∨∼q) ∨q and p
A: Here in this question we have given two statement and we have asked to write true if they are…
Q: Write code to check if the variable, value, is either 2, 5, 8 or 10. If so, output the value…
A: Given: Write code to check if the variable, value, is either 2, 5, 8 or 10. If so, output the value…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- 3.27 LAB: Login name Write a program that creates a login name for a user, given the user's first name, last name, and a four-digit integer as input. Output the login name, which is made up of the first six letters of the first name, followed by the first letter of the last name, an underscore (_), and then the last digit of the number (use the % operator). If the first name has less than six letters, then use all letters of the first name. Ex: If the input is: Michael Jordan 1991 the output is: Your login name: MichaeJ_1 Ex: If the input is: Nicole Smith 2024 the output is: Your login name: NicoleS_421.7 LAB: Login name (Use python) Write a program that creates a login name for a user, given the user's first name, last name, and a four-digit integer as input. Output the login name, which is made up of the first five letters of the last name, followed by the first letter of the first name, and then the last two digits of the number (use the % operator). If the last name has less than five letters, then use all letters of the last name. Ex: If the input is: Michael Jordan 1991 the output is: Your login name: JordaM91 Ex: If the input is: Kanye West 2024 the output is: Your login name: WestK24Program - python A nutritionist who works for a fitness club helps members by evaluating their diets. As part of her evaluation, she asks members for the number of fat grams and carbohydrate grams that they consumed in a day. Then, she calculates the number of calories that result from the fat, using the following formula: calories from fat = fat grams x 9. Next, she calculates the number of calories that result from the carbohydrates, using the following formula: calories from carbs = carb grams x 4. Write a program that will make these calculations. Your program should use two separate functions to calculate fat and carb calories. Write a 3rd function that is called from main to capture user input and call the others.
- (Conversion) a. Write a C++ program to convert meters to feet. The program should request the starting meter value, the number of conversions to be made, and the increment between metric values. The display should have appropriate headings and list the meters and the corresponding feet value. If the number of iterations is greater than 10, have your program substitute a default increment of 10. Use the relationship that 1 meter = 3.281 feet. b. Run the program written in Exercise 6a on a computer. Verify that your program begins at the correct starting meter value and contains the exact number of conversions specified in your input data. c. Modify the program written in Exercise 6a to request the starting meter value, the ending meter value, and the increment. Instead of the condition checking for a fixed count, the condition checks for the ending meter value. If the number of iterations is greater than 20, have your program substitute a default increment of (ending value - starting value) / 19.C Program In order to discourage excess electric consumption, an electrical company charges its customers a lower rate of P75 for the first 250 kilowatt-hours and a higher rate of P8.5 for each additional kilowatt-hour. In addition, a 10% surtax is added to the final bill. Write a program that calculates the electrical bill given the number of kilowatt-hours consumed as input. At the end, print the number of kilowatt-hours consumed and the computed bill.ex program for this
- 17.1 LAB: Convert to seconds Write a program that reads in hours, minutes, and seconds as input, and outputs the time in seconds only. Ex: If the input is: 1 6 40 where 1 is the number of hours, 6 is the number of minutes, and 40 is the number of seconds, the output is: Seconds: 4000 344614.2153518.qx3zqy7do 2.6 after u do the first one5.28 LAB: Convert to binary - functions Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binary. For an integer x, the algorithm is: As long as x is greater than 0 Output x % 2 (remainder is either 0 or 1) x = x / 2 Note: The above algorithm outputs the 0's and 1's in reverse order. You will need to write a second function to reverse the string. Ex: If the input is: 6 the output is: 110 Your program must define and call the following two functions. The IntegerToReverseBinary() function should return a string of 1's and 0's representing the integer in binary (in reverse). The ReverseString() function should return a string representing the input string in reverse. string IntegerToReverseBinary(int integerValue)string ReverseString(string userString)
- 17.54 PRACTICE: Functions***: Output guitar tabs C++ An earlier problem introduced guitar tabs. In this problem, the user can enter a sequence of chords, and the program should output the tabs in sequence. The first input is the number of chords to follow. If the input is 4 G C G D, the output should be: e|-3-0-3-2- B|-0-1-0-3- G|-0-0-0-2- D|-0-2-0-0- A|-2-3-2--- E|-3---3--- Hints: Use 6 C++ strings, one for each guitar string ("string" below will mean C++ string unless otherwise noted). Start by the e string with "e|-", the B string with "B|-", etc. For each user chord, append (using append()) to each string the appropriate item (a number or -) plus -, like "2-". When done, print the 6 strings one at a time separated by newlines.Program thispython code Problem 5 A nutritionist who works for a fitness club helps members by evaluating their diets. As part of her evaluation, she asks members for the number of fat grams and carbohydrate grams that they consumed in a day. Then, she calculates the number of calories that result from the fat, using the following formula: calories from fat = fat grams x 9. Next, she calculates the number of calories that result from the carbohydrates, using the following formula: calories from carbs = carb grams x 4 . Write a program that will make these calculations. Your program should use two separate functions to calculate fat and carb calories. Write a 3rd function that is called from main to capture user input and call the others.