Time and weather Write a program to take as input and 4-digit number from the user. The first two digits represent the day of the month and the last two digits represent the month of the year. The program should then display the following: "It's winter" if the month entered is 12, 1 or2 . "It's Spring" if the month entered is 3, 4, or 5 "It's Summer", if the month entered is 6,7, or 8 "It's Fall", if the month entered is 9, 10, or 11 The program should also display the current week number of the month

Answers

Answer 1

Answer:

#here is program in python

#read 4 digit number

date=int(input("enter the date:"))

#first 2 digit is day

day=int(date/100)

#last 2 digit is month

month=date%100

#find the week of the month

if day<=7:

  week=1

elif day>=8 and day<=14:

  week=2

elif day>=15 and day<=21:

  week=3

elif day>=22 and day<=28:

  week=4

elif day>=29:

  week=5

#check for Winter

if month in [12,1,2]:

  print("week {} of Winter.".format(week))

# check for Spring

elif month in [3,4,5]:

  print("week {} of Spring.".format(week))

#check for Summer

elif month in [6,7,8]:

  print("week {} of Summer.".format(week))

#check for Fall

elif month in [9,10,11]:

  print("week {} of Fall.".format(week))

Explanation:

Read a 4 digit number from user.first 2 digits represents the day and last 2 month.Then find the week of the month.If the month is in [12,1,2] then it will print "Winter" and week of that month.If month is in [3,4,5] then print "Summer" with week.If the month is in [6,7,8] then "Summer" and if the month is in [9,10,11] then "Fall".

Output:

enter the date:1212

week 2 of Winter.


Related Questions

Which of the following views hides the ribbon and shows text on the screen in an easy-to-read format?: *
a. Full Screen Reading
b. Web Layout
c. Print Layout
d. Draft

Answers

Answer: a)Full Screen Reading

Explanation: Full screen reading is the option present for the reading the text format easily on the system screen .This mode works by minimizing the extra data elements like menus of the screen. The full screen reading mode is usually preferred while there is the requirement of only reading without any editing.

Other options are incorrect because web layout is the layout of the web page, print layout is the tab for printing the layout of page options and draft is the written document which can be edited .Thus , the correct option is option(a)

Answer:

1. toolbar

2. reading

3. double-click

Explanation:

in 2015, what percent of Internet users will access the web through mobile devices?

Answers

Answer:

52.7 percent.

Explanation:

In 2015 52.7 percent of the internet users accessed the internet from their mobile phones.

This number has kept on increasing throughout the years and it will keep on increasing because of the lucrative offers provided by the telecom service providers on the internet data packs and the revolution in India brought by Reliance Jio in 2016 because of which the rates of the data packs declined very sharply and also by every telecom service provider because of reliance Jio.

Name 3 responsibilities of TCP.

Answers

Answer:

 The three basic responsibilities of the TCP are:

TCP is the transport layer protocol and it is basically responsible for maintain the end to end network communication. TCP is used for delivering the data and also make sure that the order of the packets are similar with the actual message. The transmission control protocol (TCP) is basically handle the communication between the host for establish an efficient connection so that they can easily exchange the data or information. It also provide the flow control in the network protocol and help in the multiplexing of the data to make the network more reliable.  

A day has 86,400 seconds (24*60*60). Given a number of seconds in the range of 0 to 1,000,000 seconds, output the time as days, hours, minutes, and seconds for a 24- hour clock. E.g., 70,000 seconds is 0 days, 19 hours, 26 minutes, and 40 seconds. Your function should output: Time is W days, X hours, Y minutes, and Z seconds. Your function should take the number of seconds as an integer parameter Your function MUST be named howLong.

Answers

Answer:

// here is code in c++.

// include headers

#include <bits/stdc++.h>

using namespace std;

// function that calculate days, hours, minutes and seconds

void howLong(int sec)

{

   // find days

   int days=sec/86400;

   // update the seconds

   sec=sec%86400;

   // find hours

   int h=sec/3600;

   // update the seconds

   sec=sec%3600;

   // find minutes

   int min=sec/60;

   // update the seconds

   sec=sec%60;

   // output

   cout<<sec<<"seconds is "<<days<<" days,"<<h<<" hours,"<<min<<" minutes,and "<<sec<<"seconds."<<endl;

}

// driver function

int main()

{   // variable

   int sec;

   cout<<"Enter seconds:";

   // read the seconds

   cin>>sec;

   // call the function

   howLong(sec);

   

return 0;

}

Explanation:

Read the seconds from user.Then call the function howLong() with parameter seconds. In the function, it will first find the number of days by dividing the seconds with 86400 then update the remaining seconds.Next it will find the hours by dividing the remaining seconds with 3600 and update the remaining seconds.After that it will find the minutes by dividing the remaining seconds with 60 and update the remaining second.Then it will print the days, hours, minutes and seconds.

Output:

Enter seconds:70000

40seconds is 0 days,19 hours,26 minutes,and 40seconds.

Here's a Python implementation of the howLong function that takes the number of seconds as an integer parameter and outputs the time in days, hours, minutes, and seconds:

def howLong(seconds):

   days = seconds // 86400

   hours = (seconds % 86400) // 3600

   minutes = (seconds % 3600) // 60

   seconds = seconds % 60

   return "Time is {} days, {} hours, {} minutes, and {} seconds.".format(days, hours, minutes, seconds)

Thus, we format the output string using the obtained values for days, hours, minutes, and seconds and return it.

For more details regarding python, visit:

https://brainly.com/question/30391554

#SPJ6

.An algorithm specifies the actions to be executed.

True

False

Answers

Answer:

True.

Explanation:

An algorithm for a problem provides the set of instructions that are required to solve a problem.It does not provide the full code.It is like an abstract solution of a problem.It is just like a recipe for cooking a dish.It will not cook food for you but can tell you how to cook.

Since it provides the action to be executed hence the answer is True.

Answer:

true

Explanation:

The basic building block of a system is the _____. (Points : 6) object
attribute
message
partition
method

Answers

Answer: Object

Explanation: Object is a major part of a system that has the relevance with the real world entities.The objects are used in the object-oriented approach in the operating system for the development and maintenance of it.

It is the component that comprises of the two major factors-code and data. The code and data are for the determination of the behavior and the status of the object respectively. Other options are incorrect because they don't operate as the building block for a system.

The method with the declaration public static char procedure(double d) has a method type of . a) public b) static c) char d) double

Answers

Answer:

Option(c) is the correct answer for the given question .

Explanation:

Public is the access modifier not a method type so option(a) option is wrong.

Static is not return type static keyword before the method of procedure means it is directly accessed with the help of class name so option(b) is also wrong.

double is the datatype of variable d it is not the method type so option(d) is also wrong  

So char is the method type of the method procedure.

Therefore option (c) is the correct answer.

A remediation liaison makes sure all personnel are aware of and comply with an organization's policies.

True

False

Answers

Answer:

False.

Explanation:

I believe this should be the work of a compliance liaison. Assume you have opened up an organization that is growing each day. You have employees who are required to be compliant with all the security standards and policies. Hiring a compliance liaison will ensure that these compliances are being carried out. Each department in an organization should work with a compliance liaison to ensure that its employees understand and comply fully with all security policies.

. Which of the following is the command for backing up a database from the command line?
(a) mysqlslap
(b) mysqlshow
(c) mysql --backup
(d) mysqldump

Answers

Answer:d) mysqldump

Explanation: The backing up of the database is the function that is operated by the MYSQL. The database that is to be backed up is known as the dump data ,which contains the data files in the text format."mysqldump" command is the SQL command that is given for the extraction of the single database as well as multiple databases.

This command works by recreating the data files by copying it in a quick manner.Other options are incorrect because those commands don not work in MYSQL for creating a backup of database.Thus, the correct option is option(d).

Write a program that continues to read positive integer values until user enters a negative value. The program should print average of entered values, maximum value and minimum value

Answers

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

int main()

{

// variable

   int n;

   int mi=INT_MAX;

   int mx=INT_MIN;

   double avg;

   int count=0;

   double sum=0;

   cout<<"enter a positive integer(Negative number to stop):";

   // read the input first time

   cin>>n;

   // read the input until user enter a negative number

   while(n>=0)

   {

   // calculate minimum

       if(n<mi)

       mi=n;

       // calculate maximum

       if(n>mx)

       mx=n;

       // count of entered numbers

       count++;

       // total sum of all number

       sum=sum+n;

       cout<<"enter a positive integer(Negative number to stop):";

       // read the input again

       cin>>n;

   }

   // calculate the average

   avg=sum/count;

   // print the average

   cout<<"average of "<<count<<" number is:"<<avg<<endl;

   // print the maximum

   cout<<"maximum of all number is:"<<mx<<endl;

   // print the minimum

   cout<<"minimum of all number is:"<<mi<<endl;

return 0;

}

Explanation:

Declare and initialize "mi" with maximum integer value.Similarly "mx" with minimum integer value.Read user input until user enter a negative number.Add all the number to variable "sum" and keep count of positive number entered with "count".When user enter a negative number then it will stop taking input and calculate average of all number by dividing sum with count. Also it will check for each and find the maximum and minimum among the all input.

Output:

enter a positive integer(Negative number to stop):23

enter a positive integer(Negative number to stop):10

enter a positive integer(Negative number to stop):34

enter a positive integer(Negative number to stop):22

enter a positive integer(Negative number to stop):5

enter a positive integer(Negative number to stop):-2

average of 5 number is:18.8

maximum of all number is:34

minimum of all number is:5

what are somd negetive aspects and some positive aspects of having robots as a part of workplace?

Answers

Answer and Explanation:

Some of the negative aspects of robots at work place:

Lesser flexibilityHigher maintenance and installation costFuture insecurity and risk if the system malfunctionsA decline in the opportunities for humansUnemployment as a result of automation and robot regulated work place.

Some of the positive aspects of robots at work place:

Higher accuracy Higher speeds More work in less timeProductivity and hence efficiency will increaseCost of some operations is reduced.Ease of employing in dangerous and hazardous fields by using specific robots for each task

. Convert 2AF from hexadecimal to binary. Show your work.

Answers

Answer:

The answer is 2AF₁₆ = 687₁₀ =  1010101111₂.

Explanation:

To convert from hexadecimal base system to binary base system, first you can do an intermediate conversion from hexadecimal to decimal using this formula:

[tex]N = x_1 * 16^0 + x_2 * 16^1 + x_3 * 16^2 + x_4 * 16^3+ ... + x_n 16^n^-^1[/tex]

, where position of the x₁ is the rightmost digit of the number and:

A = 10.B = 11.C = 12.D = 13.E = 14.F = 15.

2AF₁₆ = 2*16²+A*16¹+F*16⁰ = 512 + 160 + 15 = 687₁₀

Now, transform from decimal to binary the number 687. Divide the number repeatedly by 2, keeping track of each remainder, until we get a quotient that is equal to 0:

687 ÷ 2 = 343 + 1;343 ÷ 2 = 171 + 1;171 ÷ 2 = 85 + 1;85 ÷ 2 = 42 + 1;42 ÷ 2 = 21 + 0;21 ÷ 2 = 10 + 1;10 ÷ 2 = 5 + 0;5 ÷ 2 = 2 + 1;2 ÷ 2 = 1 + 0;1 ÷ 2 = 0 + 1;

Now, construct the integer part base 2 representation, by taking the remainders starting from the bottom of the list:

687₁₀ =  1010101111₂

Which is the last line of defense in a physical security sense?

A. People

B. Interior barriers

C. Exterior barriers

D. Perimeter barriers

Answers

Answer: (A) People

Explanation:

 The physical security system is the basically used in the information system. It is used in the technical and the administrator element in the security system. This is the technology oriented system that is basically used to prevent from the hacking attacks in the system.

So, the people is the last statement of the defense in the physical security as the various security system is basically used by various people.

. The first step in devising security services and mechanisms is to develop a security policy True False

Answers

Answer: True

Explanation: For the creation of the security services and function the first step is having a policy regarding the security measure that is to be taken.Security policy consist of the procedures and function that should be implement in the system as a plan.

It monitors the flow,accessing of external component ,data assessment etc fro the protection.After the policies are made then the implementation take place. The most common deployment of this policy is in information technology(IT)sector .Thus, the given statement is true..

What is the downside of wider channel bandwidth?

Answers

Answer: Wider channel bandwidth has several downside or disadvantages to it. Some of these are as follow:

a) Higher channel bandwidth means lower will be the number of channels being utilized.

b) Wider bandwidth may lead to an increase in the speed but on the other hand, it'll lead to several interference problems.

. If the sub-expression on the left of the __________ logical operator is true, the right

sub-expression is not checked.

Answers

Answer: "║"(OR) logical operator

Explanation:   "ll" logical is used for defining the OR  logical condition.This condition returns a value of true or false according to given expression.This expression can work on the Boolean variables only.

In this operator if any argument turn out to be true , the value returned is true otherwise the answer returned will be false.It also features that if the left side of this operator is true then the right sub-part of it's not evaluated as it becomes true overall.

Example of expression->  x ║ y ;

What is ‘White-Box’ testing?

Answers

Answer:

 The white box testing is the method in which it basically test the internal structure and working application in the software testing.

In the white box testing the programming skills are require for designing the various test cases.

White box testing is also known as open box testing and it require the specific knowledge of the programming language for examine the particular software testing output.

Answer:

    The White Box test is a software test in which the developer has access to the source code, knowing the internal structure of the product. Being analyzed and allowing the choice of specific parts of a component to be evaluated, allowing a precise search of the behavior of the structure.

    The white box test levels are Unit Tests and Static Test.

Why do small incremental code changes in software have to do with testing?

Answers

Answer:

It is method where the product is designed, implemented and tested incrementally until the product is finished.

Explanation:

Small incremental codes are used to find the errors or bugs in the program coding or in the development of software. The whole process of incremental codes in software testing is categorized in smaller chunks, and the process is executed in steps of design, requirement, and implementation. If an error occurs in each step of the testing phase, it will be detected. This process is economical and easy to use due to smaller chunks.

In Java, write a program that asks a user for the total cost of a purchase and calculates the tax and the total purchase price. Make sure to write out the cost of the purchase, the tax, and the total purchase price formatted to two decimal places using the NumberFormat class.

Answers

Answer:

646i01

Explanation:

Beause this number use 10

Briefly tell me what a POST request does

Answers

Answer: POST request is the concept used in world wide web(www) for the working of HTTP (hyper text transfer protocol) .It is required for sending the data to the web servers by requesting through request messages.

The functions performed by POST are uploading of file, storing file ,providing information,updating information,filling web form etc,. POST is a type of request method which also contains content as body..

Write an application that calculates and displays the weekly salary for an employee. The main() method prompts the user for hourly pay rate, regular hours, and overtime hours. Create a separate method to calculate overtime pay, which is regular hours times the pay rate plus overtime hours time 1.5 times rate; return the result to the main() method to be displayed

Answers

Answer:

// here is program in java.

// import package

import java.util.*;

// class definition

class Main

{

   // method to calculate weekly salary

   public static double fun(int h_p_r,int r_h,int o_h)

   {

       // calculate weekly salary

       double weekly_salary=(h_p_r*r_h)+(o_h*h_p_r*1.5);

       // return salary

       return weekly_salary;

   }

   // main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // object to read value from user

    Scanner scr=new Scanner(System.in);

    // ask to enter hourly pay rate

       System.out.print("enter hourly pay rate: ");

       // read hourly pay rate

       int hourly_pay_rate=scr.nextInt();

       // ask to enter regular hours

       System.out.print("enter regular hours: ");

       //read regular hours

       int regular_hours=scr.nextInt();

       // ask to enter overtime hours

       System.out.print("enter overtime hours : ");

       // read overtime hours

       int overtime_hours=scr.nextInt();

       // call the method

       System.out.println("weekly salary of an employee :"+fun(hourly_pay_rate,regular_hours,overtime_hours));

   }catch(Exception ex){

       return;}

}

}

Explanation:

Read hourly pay rate, regular hours and overtime hours from user.Call the method fun() with these parameters.There weekly salary is calculated by multiply regular hours with hourly_pay_rate and overtime hours with 1.5 time of hourly_pay_rate.Sum both of them, this will be the weekly salary.return this to main method and print it.

Output:

enter hourly pay rate: 20

enter regular hours: 40

enter overtime hours : 10

weekly salary of an employee :1100.0

The network administrator is often involved in selecting and implementing network security measures such as firewalls and access codes.
True
False

Answers

Answer: True

Explanation:

 Yes, the given statement is true that the network administrator are basically involve in the select and implement the various network security measures like the access code and firewall.

The network administrator is basically responsible for managing, implementing and troubleshooting the LAN areas that is local area network in the organization. The network administrator is the technology which is widely used now a days for efficient development. It is also interface with the internet and wide area networks (WAN).

controls to keep password sniffing attacks from compromising computer systems include which of the following?

a.Static and recurring passwords

b.Encryption and recurring passwords

c.One-time passwords and encryption

d.Static and one-time passwords

Answers

Answer:

the answer is b your welcome

Write a program with the following output: ( Notice the beeline and space). Hello world! Hello

Answers

Answer:

#include <iostream>

using namespace std;

int main() {

cout<<"Hello world! Hello";//statement to print the statement.

return 0;

}

Explanation:

The above written program is in C++.In C++ cout is used to print ouput on the screen and it is called standard output.So to print Hello world! Hello you have to code

cout << "Hello world! Hello";

This will print the statement.

Answer:

Hello!

Explanation:

Discuss operations of vectors in computer graphics?

Answers

Answer:

  In the computer graphics, the vectors are basically used to compose various type of components. In the computer graphics it is basically known as vector graphics and it is composed of various types of components.

The operation of the vector in the computer vector is that it is basically used to create the digital images by the use of mathematical statement and command.

It is used to place the lines and the shape in the two- dimension and three- dimension spaces. IN the computer graphics, vectors are also used to represent the particular direction of the various objects.

Fill in the blank.
A _____ is the smallest unit of measurement used to describe computer processing storage.

Answers

Answer:

A  bit

Explanation:

A bit in computing or any digital communication can be defined as the smallest unit of data of storage. In the smallest scale, nothing comes before it. It is expressed in binary value storage of 0’s or 1’s. By default, eight bits make a byte.

The ____________ is a very popular form of logic used to update a sequential file when three different types of transactions are present.

(Points : 2) match and delete rule
balance line algorithm
bilateral update algorithm
simplex sequential file rule

Answers

Answer: Simplex sequential file rule

Explanation:

 The simplex sequential file rule is basically used to updated the given records in the form of order sequential file. It basically create new file which contain records that are already updated.

It contain three types of the transactions that is add, delete and change to updated the records in the sequential file. In the simplex sequential file, the transaction file records are same as the records in the master file.

On the other hand, all the given other options are incorrect because it does not involve in the transaction process.

Therefore, simplex sequential file rule  option is correct.  

Prove the following theorems using truth table (a) X + XY = X (b) X + YZ = (X + Y)(X + Z)

Answers

Answer:

I attached you the answer in the picture

Explanation:

First, let's see the relationship between the logic gates and truth tables:

The operation of logic gates in relation to one another may be represented and analyzed using a branch of mathematics called Boolean Algebra which, like the common algebra, deals with manipulation of expressions to solve or simplify equations. Expressions used in Boolean Algebra are called, well, Boolean expressions.

AND Gate:

The AND gate is a logic gate that gives an output of '1' only when all of its inputs are '1'.  Thus, its output is '0' whenever at least one of its inputs is '0'. Mathematically, A∧B = A · B.

OR Gate:

The OR gate is a logic gate that gives an output of '0' only when all of its inputs are '0'. Thus, its output is '1' whenever at least one of its inputs is '1'. Mathematically, A∨B = A + B.

Having this in mind, we just need to use basic Mathematical Logic operations

Which device makes computers that are connected to separate segments appear and behave as if they're on the same segment? (Please choose from one of the four options below)

Bridge

Hub

Router

Switch

Answers

Answer: Switch

Explanation:

 The switch is the device that is basically use for the connection for separate segment that basically appear in the similar segment in the computer network.

Switch is the ethernet that is based on the  LAN peruses approaching TCP/IP information packets containing goal data as they go into at least one info ports. The goal data in the bundles is utilized to figure out which yield ports that will be utilized to sending the information on to its proposed goal.

Therefore, Switch is the correct options.

 

Debbie would like to create a file that she can use as a starting point to create other files for her English class. What should she create?: *
a. a content control
b.a style
c. a template
d.a theme

Answers

Answer:

c. a template.

Explanation:

She should first create a Template so that she can use it as a starting point to create other files.

A template is file created with a blueprint with  a format that can be used for a group of documents.For example:- there are different templates present of the resume.

Hence the answer to this question is template.

Other Questions
What is 5/1 7 3/6 and 3 1/3 2 2/4 simplify? In the United States, nonprofits employ about one in hundred workers, accounting for less paid workers than the entire construction industry and less than the finance, insurance, and real-estate sectors combined.True / False. Part A - Processes that determine heredity and contribute to genetic variation Meiosis guarantees that in a sexual life cycle, offspring will inherit one complete set of chromosomes (and their associated genes and traits) from each parent. The transmission of traits from parents to offspring is called heredity. Another important aspect of meiosis and the sexual life cycle is the role these processes play in contributing to genetic variation. Although offspring often resemble their parents, they are genetically different from both of their parents and from one another. The degree of variation may be tremendous. The following processes are associated with meiosis and the sexual life cycle: DNA replication before meiosis crossing over chromosome alignment in metaphase I and separation in anaphase I chromosome alignment in metaphase II and separation in anaphase II fertilization Sort each process into the appropriate bin according to whether it contributes to heredity only, genetic variation only, or both. -dna replication(assume no errors), -crossing over, -metaphase 1 -> anaphase 1, -metaphase 2 -> anaphase2, -fertilization hereditary only: genetic variation only: both: Evaluate the expression below4 - 2 2x2 + 3Is my answer right he continuity of life is based on heritable information in the form of DNA. In a short essay (100150 words), explain how the passage of genes from parents to offspring, in the form of particular alleles, ensures perpetuation of parental traits in offspring and, at the same time, genetic variation among offspring. Use genetic terms in your explanation. Considering the research on preschoolers' ability to provide accurate testimony about past events, which piece of advice would be the MOST important for an interviewer to be told prior to interviewing a young child? a) Bring a doll to aid the child in answering your questions. b) Make sure you know the answers to the questions before asking the child. c) If you do not think the child has answered a question accurately, ask the question again. d) Ask questions that will help children to testify accurately. Describe whether is it ethical to use fear appeals to increase demand for emergency response devices among elderly consumers. Jasons salary and Karens salary were each p percent greater in 1998 than in 1995. What is the value of p ? (1) In 1995 Karens salary was $2,000 greater than Jasons. (2) In 1998 Karens salary was $2,440 greater than Jasons. difference between declaration of independence and common sense Based on the graph, what is the initial value of the linear relationship?(A) 2(B) 0(C) 2/3(D) 3 Who was the author of the famous storybook 'Alice's Adventures in Wonderland'? HELP needed!!Completely the steps to find the value of x in the angle? Descriptions of mauryan empire Solve the inequality Show your work-5/2(3x+4) The sum of three numbers is 95. The first number is 5 more than the third. The second number is 4 times the third. What are the numbers? Which President established the custom of not seeking a third term? What was one reason that Patriots were more willing to go to war with britian than the loyalist ? Mutations that improve an individuals ability tosurvive and reproduce are Know the difference between lipid soluble and water soluble hormones and how they elicit their effects on target cells. Write the equation of the sequence in the form y = mx + b:0.5, 2.5, 4.5, ...