
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
![Write a shell script to check if a number is even or odd, if number is even calculate factorial of a number n otherwise find value of z, where
z=2/4+4/6+6/8+.+n/n+2.
[Factorial of a number example: 5!=5*4*3*2*1]](https://content.bartleby.com/qna-images/question/37cdb2d0-396c-4dea-86e7-05115d2f5764/ce415da6-b9a6-4e2a-b65b-eef1afb06ddf/bbdaj5a_thumbnail.jpeg)
Transcribed Image Text:Write a shell script to check if a number is even or odd, if number is even calculate factorial of a number n otherwise find value of z, where
z=2/4+4/6+6/8+.+n/n+2.
[Factorial of a number example: 5!=5*4*3*2*1]
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

Knowledge Booster
Similar questions
- Write a java program that ask user to input number of bits, apply formula of calculating range in order to display the range from -ve value to +ye value and print a message "the range is for byte or short or int or long, etc." For example, the sample output format is as follows: C:\Users\janna\Desktop\Programming in Java\Mid Term Exam\Q2>java Range Please enter the number of bits: 8 -128.0 to 127.0 The range is for Byte Write a program that converts Fahrenheit temperature to Celsius and Kelvin temperature. You should have two static methods in the class TemperatureConversion. One method is fahrenheitToKelvin and other is fahrenheitToCelsius. Both methods accept Fahrenheit temperature as an argument. These methods should return the converted temperature such as Celsius and kelvin to the calling environment. Use a loop to call methods 20 times and increment Fahrenheit by 0.1 each time. I have used format specifiers to format the output of my program. C:\Users\janna\Desktop\Programming in…arrow_forwardWrite only one of them Java or C++ code using a file reading (the file is worth below) CreditCard.txt ***I want to solve as soon as possible.arrow_forwardThis question does not require you to run any R code. But suppose you did run the command sd(rpois(n, lambda)) where λ=(1+1)/2 and n was set to be an extremely large number. What answer would you expect? Give your answer as a decimal to two decimal places.arrow_forward
- Coral lang!!! Sites like Zillow get input about house prices from a database and provide nice summaries for readers. Write a program with two inputs, current price and last month's price (both integers). Then, output a summary listing the price, the change since last month, and the estimated monthly mortgage computed as (currentPrice * 0.045) / 12. Ex: If the input is 200000 210000, the output is: This house is $200000. The change is $-10000 since last month. The estimated monthly mortgage is $750.0. Note: Getting the precise spacing, punctuation, and newlines actly right is a key point of this assignment. Such precision is an important part of programming.arrow_forwardin java eclipse ide can you insert the numbers in the code pleasearrow_forwardIn python please provide the code On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * rn, where n is the distance (number of keys) from that key, and r is 2(1/12). Given an initial key frequency, output that frequency and the next 4 higher key frequencies. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print(f'{your_value1:.2f} {your_value2:.2f} {your_value3:.2f} {your_value4:.2f} {your_value5:.2f}') Ex: If the input is: 440 the output is: 440.00 466.16 493.88 523.25 554.37arrow_forward
- In Java: Forms often allow a user to enter an integer. Write a program that takes in a string representing an integer as input, and outputs yes if every character is a digit 0-9. Ex: If the input is: 1995 the output is: yes Ex: If the input is: 42,000 or 1995! the output is: no Hint: Use a loop and the Character.isDigit() function.arrow_forwardI need help with creating a Java program described below: Hamming distance. The Hamming distance between two-bit strings of length n is equal to the number of bits in which the two strings differ. Write a program that reads in an integer k and a bit string s from the command line, and prints all bit strings that have Hamming distance at most k from s. For example, if k is 2 and s is 0000, then your program should print 0011 0101 0110 1001 1010 1100 Hint: Choose k as the number of bits to flip in s.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY